You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Context: 518e57c
The scenario: rebuild `Xamarin.Android.Build.Tasks.csproj`:
$ xbuild src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj
*If nothing has changed*, the expectation is that this should be
reasonably quick, because *nothing has changed*.
Unfortunately, that's not the case; a rebuild could take upwards of
30sec on my local machine, becaues of rebuild cascades:
Target CoreCompile needs to be built as input file 'Xamarin.Android.Tools.BootstrapTasks/GenerateProfile.cs' is newer than output file 'obj/Debug/Xamarin.Android.Tools.BootstrapTasks.dll'
Target _BuildJNIEnv needs to be built as input file '../../bin/BuildDebug/jnienv-gen.exe' is newer than output file 'Android.Runtime/JNIEnv.g.cs'
Target CoreCompile needs to be built as input file 'Android.Runtime/JNIEnv.g.cs' is newer than output file 'obj/Debug/android-25/Mono.Android.dll'
Target _GenerateMonoAndroidDex18 needs to be built as input file '../../bin/Debug/lib/xbuild-frameworks/MonoAndroid/v7.1/mono.android.jar' is newer than output file '../../bin/Debug/lib/xbuild-frameworks/MonoAndroid/v7.1/mono.android.dex'
Target _CopyExtractedMultiDexJar needs to be built as input file '$HOME/android-toolchain/sdk/extras/android/m2repository/com/android/support/multidex/1.0.1/multidex-1.0.1.aar' is newer than output file '../../bin/Debug/lib/xbuild/Xamarin/Android/../../../mandroid/android-support-multidex.jar'
...and if I'm *really* unlucky:
Target _BuildUnlessCached needs to be built as input file '.../xamarin-android/external/mono/autogen.sh' is newer than output file '../../bin/Debug//lib/xbuild-frameworks/MonoAndroid/v1.0/FSharp.Core.dll'
...as that means an `external/mono` rebuild (!).
Most of these are due to missing `<Touch/>` task use, to ensure that a
created/generated file is newer than the `Inputs` of the associated
target.
The `<GenerateProfile/>` task is slightly more complicated: in that
case, we only want the file timestamp to change if the file contents
have changed. Alter the `GenerateProfile.Execute()` logic to perform a
content diff before writing to the file, resulting in a new timestamp.
Finally, fix `GenerateJavaCallableWrappers` target use from
`Mono.Android.csproj` by providing a "real" value for
`$(JavaCallableWrapperAbsAssembly)` so that the
`GenerateJavaCallableWrappers` target's `Inputs` and `Outputs`
reference valid (existing) files. The previous value used a
`$(JavaCallableWrapperOutputPathAbs)` property, which doesn't appear
to have been defined anywhere, and thus was `""`.
Performing these changes reduces my typical "no change"
`Xamarin.Android.Build.Tasks.csproj` rebuild time from ~30sec down to
a more reasonable ~10sec, which is much better (though more than I'd
personally like).
0 commit comments