-
Notifications
You must be signed in to change notification settings - Fork 533
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
[Xamarin.Android.Build.Tasks] remove Xamarin.Android.Windows.targets #2561
[Xamarin.Android.Build.Tasks] remove Xamarin.Android.Windows.targets #2561
Conversation
Need to look into test failures. |
@dellis1972 I need to ask you about this after the break: https://github.com/xamarin/xamarin-android/blob/46f02511f8c91b133fb09fdcad2fa8fe9f2cc730/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets#L1795-L1801 This task creates Is this path wrong, or are we deliberately keeping two copies? I'm seeing the one not in |
@jonathanpeppers we need to figure out where that |
@dellis1972 it looks like the only thing using this file: Is the It looks like:
I'm thinking I could just rework this to use the |
3fcb8c9
to
82fd227
Compare
Fixes: http://work.devdiv.io/707557 In 539954c, I was aiming to remove the `_RegisterAndroidFilesWithFileWrites` MSBuild target (runs only on Windows). I was having trouble getting everything to work, so I undid this change to make the PR smaller. Reasons to remove `_RegisterAndroidFilesWithFileWrites`: - It looks like it *may* be a source of incremental build bugs. It causes `$(CleanFile)` to grow on incremental builds indefinitely... - We should instead use the `FileWrites` item group appropriately. - We can avoid ~81ms of build time. 81 ms _RegisterAndroidFilesWithFileWrites 1 calls Revisiting it now, it looks like we can remove `Xamarin.Android.Windows.targets` completely! - `_RegisterAndroidFilesWithFileWrites` is the only target. - The `$(_IsRunningXBuild)` property is only used in this file. - I moved the `$(Debugger)` property to `Xamarin.Android.Common.props`. I believe this value is only used in VS Windows, but it make more sense to be here. ~~ CopyGeneratedJavaResourceClasses ~~ The `<CopyGeneratedJavaResourceClasses/>` MSBuild task was copying an `R.java` file from `%TEMP%` to: $(IntermediateOutputPath)android\unnamedproject\unnamedproject\R.java We only use this file in one place, since the rest of the build uses: $(IntermediateOutputPath)android\src\unnamedproject\unnamedproject\R.java We can avoid copying this extra file and adding it to `FileWrites`: - `<CopyGeneratedJavaResourceClasses/>` now optionally uses the `DestinationTopDirectory` property - If `DestinationTopDirectory` is blank, the original source file is returned as the `PrimaryJavaResgenFile` output property. We now use the `R.java` from `%TEMP%` directly, and avoid copying a file to `$(IntermediateOutputPath)`. ~~ Other Changes ~~ I modified the `CheckNothingIsDeletedByIncrementalClean` test to verify that `$(CleanFile)` isn't growing on incremental builds. Anything added to `FileWrites` during the `_CompileDex` MSBuild target (or its dependent targets) wasn't showing up in `$(CleanFile)`! I adjusted its `BeforeTargets` to match what I did in 539954c for `_PrepareAssemblies`. Two files needed to be added to `FileWrites`: - `$(_PackagedResources)` - `$(_GeneratedPrimaryJavaResgenFile)`
`obj/Debug/android/**/R.java` no longer exists after a design-time build. We can still look for `obj/Debug/android/src/**/R.java` after a full build.
82fd227
to
d7c3421
Compare
Fixes: http://work.devdiv.io/707557
In 539954c, I was aiming to remove the
_RegisterAndroidFilesWithFileWrites
MSBuild target (runs only onWindows). I was having trouble getting everything to work, so I undid
this change to make the PR smaller.
Reasons to remove
_RegisterAndroidFilesWithFileWrites
:causes
$(CleanFile)
to grow on incremental builds indefinitely...FileWrites
item group appropriately.Revisiting it now, it looks like we can remove
Xamarin.Android.Windows.targets
completely!_RegisterAndroidFilesWithFileWrites
is the only target.$(_IsRunningXBuild)
property is only used in this file.$(Debugger)
property toXamarin.Android.Common.props
. I believe this value is only used inVS Windows, but it make more sense to be here.
CopyGeneratedJavaResourceClasses
The
<CopyGeneratedJavaResourceClasses/>
MSBuild task was copying anR.java
file from%TEMP%
to:We only use this file in one place, since the rest of the build uses:
We can avoid copying this extra file and adding it to
FileWrites
:<CopyGeneratedJavaResourceClasses/>
now optionally uses theDestinationTopDirectory
propertyDestinationTopDirectory
is blank, the original source file isreturned as the
PrimaryJavaResgenFile
output property.We now use the
R.java
from%TEMP%
directly, and avoid copying afile to
$(IntermediateOutputPath)
.Other Changes
I modified the
CheckNothingIsDeletedByIncrementalClean
test toverify that
$(CleanFile)
isn't growing on incremental builds.Anything added to
FileWrites
during the_CompileDex
MSBuild target(or its dependent targets) wasn't showing up in
$(CleanFile)
! Iadjusted its
BeforeTargets
to match what I did in 539954c for_PrepareAssemblies
.Two files needed to be added to
FileWrites
:$(_PackagedResources)
$(_GeneratedPrimaryJavaResgenFile)