-
Notifications
You must be signed in to change notification settings - Fork 564
[Xamarin.Android.Build.Tasks] remove the linksrc directory #3359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
835f0d0 to
9bb1589
Compare
|
Unfortunately there is a problem here:
With the current implementation of |
d72750e to
04b1770
Compare
04b1770 to
cfdaa89
Compare
707e52f to
47b4bf2
Compare
532db4e to
371e135
Compare
Added -r --reference option to add information about processed assemblies references. Also make it possible to use response file with additional command line arguments. The file can be specified by @response_file at the command line. That might help with dotnet/android#3359
Added -r --reference option to add information about processed assemblies references. Also make it possible to use response file with additional command line arguments. The file can be specified by @response_file at the command line. That might help with dotnet/android#3359
I've removed various MSBuild targets that copy assemblies into the
`obj\Debug\linksrc` directory, and instead just use
`@(ResolvedUserAssemblies)` or `@(ResolvedAssemblies)` where
appropriate.
Things seem to *work*, I can build and deploy `samples\HelloWorld` and
the Xamarin.Forms app in this repo. Let's see what breaks?
The size of `tests\Xamarin.Forms-Performance-Integration\Droid\obj\`
is improved dramatically:
Before:
184.27 MB
After:
111.74 MB
~73MB savings.
These MSBuild tasks were completely removed:
3 ms _CopyMdbFiles 1 calls
43 ms _CopyPdbFiles 1 calls
127 ms _CopyIntermediateAssemblies 1 calls
I will need to retest this on a slower machine where I'm seeing
Windows Defender have an impact on build times.
~~ Changes for jnimarshalmethod-gen ~~
Because `jnimarshalmethod-gen` edits assemblies in `linksrc` in-place,
before the linker, I added an extra `jnisrc` directory to accommodate
for this.
The new behavior is:
* `jnimarshalmethod-gen` outputs assemblies to `jnisrc`, it outputs a
subset of `@(ResolvedAssemblies)`.
* `_LinkAssembliesShrink` uses files form `jnisrc` if they exist and
`@(ResolvedAssemblies)` otherwise.
I also use the new `-r` switch, so any needed assemblies can be loaded.
371e135 to
199b868
Compare
|
@radekdoulik after I've switched this around to use This only happens because our tests on Azure DevOps are running against a system install. Is |
|
Indeed, we were opening the assemblies with |
|
@radekdoulik got past that one, thanks. There is a new error though 😞: Is this |
Definitely, it should be generated in the directory specified by The assembly itself is temporary. |
|
dotnet/java-interop#483 should fix it. |
Changes: dotnet/java-interop@60e85b0...8ed9677 Fixes for `-o` in `jnimarshalmethod-gen.exe`.
8040bff to
8150730
Compare
|
Ok, this actually looks green now. Jenkins looks like what we see on master. |
|
We just upgraded to VS 2019 and this change appears to have broken obfuscation with our Xamarin.Android builds. We were performing obfuscation in the AfterBuild target, then copying our obfuscated assemblies into the linksrc directory after the _CopyIntermediateAssemblies target. Due to this change, this no longer works. Can you provide suggestions on which build target we should use to perform obfuscation? Also, where does the linker look for assemblies (e.g. where should be copy our obfuscated assemblies)? |
|
@mjo151 the convention in MSBuild is that anything prefixed with an underscore is private. Meaning it might change from release to release. (MSBuild is all global variables otherwise) However, you can easily copy the files to a directory yourself and fix up the You can check if |
I've removed various MSBuild targets that copy assemblies into the
obj\Debug\linksrcdirectory, and instead just use@(ResolvedUserAssemblies)or@(ResolvedAssemblies)directlyThings seem to work, I can build and deploy
samples\HelloWorldandthe Xamarin.Forms app in this repo. Let's see what breaks?
The size of
tests\Xamarin.Forms-Performance-Integration\Droid\obj\is improved dramatically:
~73MB savings.
These MSBuild tasks were completely removed:
On a slower machine with Windows Defender enabled, these targets are
taking:
On the slower machine, the overall time was even more drastic:
With Windows Defender processes using the CPU, the overall build time
is improved by ~3.5 seconds?
Changes for jnimarshalmethod-gen
Because
jnimarshalmethod-genedits assemblies inlinksrcin-place,before the linker, I added an extra
jnisrcdirectory to accommodatefor this. Then when
_LinkAssembliesShrinkruns, it operates onassemblies in the
jnisrcdirectory.We can revisit this if
$(AndroidGenerateJniMarshalMethods)everbecomes default.