Commit 2f1234c
committed
[Java.Interop] $(Version) depends on TargetFramework
Context: 2d5431f
Context: 88d6093
Context: dotnet#936
Context: https://github.com/jonpryor/java.interop/commits/jonp-registration-scope
Versioning is hard.
Way back in 3e6a623 we tried to use the `GitInfo` NuGet package so
that *all* assemblies would have a version number which contained the
number of commits since `GitInfo.txt` changed.
This turned out to have unanticipated breakage, and was largely
reverted in 2d5431f for "core" libs like `Java.Interop.dll`.
This still presents a problem, though: the *point* to assembly
versioning is to prevent accidental breaking of referencing
assemblies. If we add a new member to `Java.Interop.dll` but
*fail to update the version*, then that *permits* a scenario in which
an app/lib depends on the new member, but is built against a version
missing that member. This result in runtime exceptions.
The whole reason this hasn't been a problem so far is because
`Java.Interop.dll` has barely changed in *years*. (Plus, most usage
is hidden behind other layers and libs…)
However, *I want this to change*: dotnet#936 and
jonpryor/java.interop/jonp-registration-scope both *add* new public
API to `Java.Interop.dll`, and there are other features and
optimizations we're considering that would also require API changes.
A policy of "no changes" isn't tenable.
Thus, the first priority: allow `Java.Interop.dll` built for .NET 6 to
have a different `$(Version)` than the one built for .NET Standard 2.0.
Fixing this was unexpectedly problematic, as commit 88d6093:
> Update[d] `Java.Interop.BootstrapTasks.csproj` to *no longer* `<Import/>`
> `VersionInfo.targets`, as this causes a circular dependency
> (`VersionInfo.targets` uses tasks from
> `Java.Interop.BootstrapTasks.dll`). This is fine, as
> `Java.Interop.BootstrapTasks.dll` doesn't need to be versioned.
`Java.Interop.BootstrapTasks.dll` doesn't need to be versioned, but
*other libraries **do***, and this change change meant that
`VersionInfo.targets` was *never* used, which in turn meant that e.g.
`bin/BuildDebug/Version.props` was never created.
Re-introduce `VersionInfo.targets` by "moving" it into
`build-tools/VersionInfo/VersionInfo.csproj`, and adding
`VersionInfo.csproj` to `Java.Interop.BootstrapTasks.sln`.
This allows the `Prepare` target to create
`bin/Build$(Configuration)/Version.props`.
Next, update `Java.Interop.csproj` so that `$(Version)` is
*conditional* on `$(TargetFramework)`. This allows it to continue
using version 0.1.0.0 for .NET Standard 2.0, and begin using
6.0.0.* for .NET 6+ builds.
Finally -- and most of the "noise" in this commit -- "cleanup and
unify" the disparate build systems. `make prepare all` is one world,
while `dotnet` is a different and overlapping world.
Clean this up: the `dotnet`-based MSBuild environment is now our
Source Of Truth, and the `make` targets are updated to rely on the
`Prepare` target instead of duplicating most of the logic.
While cleaning up `Makefile`, remove other cruft such as the explicit
`gcc` calls to build the `NativeTiming` lib (we have a `.csproj` as
of 5c756b1; use it!), and rationalize
`Java.Runtime.Environment.dll.config` generation.1 parent 32635fd commit 2f1234c
File tree
15 files changed
+106
-163
lines changed- build-tools
- Java.Interop.BootstrapTasks/Java.Interop.BootstrapTasks
- VersionInfo
- scripts
- src
- Java.Interop.Export
- Java.Interop
- Java.Runtime.Environment
15 files changed
+106
-163
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | 15 | | |
22 | 16 | | |
23 | 17 | | |
| |||
38 | 32 | | |
39 | 33 | | |
40 | 34 | | |
41 | | - | |
| 35 | + | |
42 | 36 | | |
43 | | - | |
| 37 | + | |
| 38 | + | |
44 | 39 | | |
45 | 40 | | |
46 | 41 | | |
| |||
52 | 47 | | |
53 | 48 | | |
54 | 49 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 50 | + | |
| 51 | + | |
71 | 52 | | |
72 | | - | |
| 53 | + | |
73 | 54 | | |
74 | 55 | | |
75 | 56 | | |
76 | 57 | | |
77 | | - | |
78 | 58 | | |
79 | 59 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
| 60 | + | |
92 | 61 | | |
93 | 62 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | 63 | | |
100 | 64 | | |
101 | 65 | | |
| |||
109 | 73 | | |
110 | 74 | | |
111 | 75 | | |
112 | | - | |
| 76 | + | |
113 | 77 | | |
114 | 78 | | |
115 | 79 | | |
| |||
153 | 117 | | |
154 | 118 | | |
155 | 119 | | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | 120 | | |
162 | 121 | | |
163 | 122 | | |
164 | 123 | | |
165 | 124 | | |
166 | | - | |
| 125 | + | |
167 | 126 | | |
168 | 127 | | |
169 | 128 | | |
| |||
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
24 | 30 | | |
25 | 31 | | |
26 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | | - | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
| |||
This file was deleted.
This file was deleted.
This file was deleted.
0 commit comments