Skip to content
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

[msbuild] Prepare for d8 (new dex compiler) #793

Merged
merged 1 commit into from
Sep 4, 2017

Conversation

atsushieno
Copy link
Contributor

You can get d8 compiler sources from https://r8.googlesource.com/

d8 expects slightly different set of command line arguments. There is no
--no-strict nor --dex arguments, and --output= is not accepted.
Classes must be explicitly specified (no assumption on "directory == classes").

With all these changes, I could build apk with this command line:

DxJarPath=/path/to/d8.jar DxExtraArguments="--debug" msbuild MyProject.csproj /t:SignAndroidPackage

With this change, anyone can offer custom NuGet package for d8 compiler
with its own custom MSBuild targets that specifies DxJarPath and
DxExtraArguments (just like what we could do for facebook proguard).

Copy link
Contributor

@dellis1972 dellis1972 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally this looks ok. I would like to know how these changes will effect a windows build. Just to make sure we don't regress existing dex support

Condition="'$(DxExtraArguments)' == ''"
/>
</CreateProperty>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@atsushieno looks like this bit is using spaces rather than tabs. I think @jonpryor likes to keep the formatting similar to the sourounding code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed!


if (MultiDexEnabled) {
cmd.AppendSwitch ("--multi-dex");
cmd.AppendSwitchIfNotNull ("--main-dex-list=", MultiDexMainDexListFile);
}
cmd.AppendSwitchIfNotNull ("--output=", Path.GetDirectoryName (ClassesOutputDirectory));
cmd.AppendSwitchIfNotNull ("--output ", Path.GetDirectoryName (ClassesOutputDirectory));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we get away without the = on this? Any idea how this will effect builds on windows?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tried a quick command run on Windows; java -jar c:\path\to\dx.jar --dex --no-strict --output foobar "path\to\mono.android.jar" worked fine.

You can get d8 compiler sources from https://r8.googlesource.com/

d8 expects slightly different set of command line arguments. There is no
--no-strict nor --dex arguments, and --output= is not accepted.
Classes must be explicitly specified (no assumption on "directory == classes").

With all these changes, I could build apk with this command line:

    DxJarPath=/path/to/d8.jar DxExtraArguments="--debug" msbuild MyProject.csproj /t:SignAndroidPackage

With this change, anyone can offer custom NuGet package for d8 compiler
with its own custom MSBuild targets that specifies DxJarPath and
DxExtraArguments (just like what we could do for facebook proguard).
@atsushieno
Copy link
Contributor Author

All the requested changes are done last week.

@dellis1972 dellis1972 merged commit b84de80 into dotnet:master Sep 4, 2017
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Mar 18, 2021
Fixes: dotnet/java-interop#790

Changes: dotnet/java-interop@bba1f07...3824b97

  * dotnet/java-interop@3824b974: [java-interop] Windows build system support (dotnet#816)
  * dotnet/java-interop@94c0c709: Bump to xamarin/xamarin-android-tools/main@554d45a (dotnet#813)
  * dotnet/java-interop@5c756b14: [Java.Interop-PerformanceTests] Support .NET Core 3.1 (dotnet#808)
  * dotnet/java-interop@daec07b6: [build] Fix various warnings (dotnet#812)
  * dotnet/java-interop@678c4bd2: [class-parse, generator] Allow showing Kotlin internals via metadata (dotnet#793)
  * dotnet/java-interop@cd4c8f80: [jnienv-gen] Generate a header file for the native functions (dotnet#809)
  * dotnet/java-interop@69767c1a: [param-name-importer] Fix NSE when updating JavaApi.AllPackages (dotnet#807)
  * dotnet/java-interop@a666a6f9: [Java.Runtime.Environment] Partial support for .NET Core (dotnet#804)
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Mar 18, 2021
Fixes: dotnet/java-interop#790

Changes: dotnet/java-interop@bba1f07...3824b97

  * dotnet/java-interop@3824b974: [java-interop] Windows build system support (dotnet#816)
  * dotnet/java-interop@94c0c709: Bump to xamarin/xamarin-android-tools/main@554d45a (dotnet#813)
  * dotnet/java-interop@5c756b14: [Java.Interop-PerformanceTests] Support .NET Core 3.1 (dotnet#808)
  * dotnet/java-interop@daec07b6: [build] Fix various warnings (dotnet#812)
  * dotnet/java-interop@678c4bd2: [class-parse, generator] Allow showing Kotlin internals via metadata (dotnet#793)
  * dotnet/java-interop@cd4c8f80: [jnienv-gen] Generate a header file for the native functions (dotnet#809)
  * dotnet/java-interop@69767c1a: [param-name-importer] Fix NSE when updating JavaApi.AllPackages (dotnet#807)
  * dotnet/java-interop@a666a6f9: [Java.Runtime.Environment] Partial support for .NET Core (dotnet#804)

Note: dotnet/java-interop@3824b974 updated
Java.Interop/src/java-interop to use `_WINDOWS`, not `WINDOWS`.
Define `_WINDOWS` when building for Windows as well.
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Mar 18, 2021
Fixes: dotnet/java-interop#790

Changes: dotnet/java-interop@bba1f07...3824b97

  * dotnet/java-interop@3824b974: [java-interop] Windows build system support (dotnet#816)
  * dotnet/java-interop@94c0c709: Bump to xamarin/xamarin-android-tools/main@554d45a (dotnet#813)
  * dotnet/java-interop@5c756b14: [Java.Interop-PerformanceTests] Support .NET Core 3.1 (dotnet#808)
  * dotnet/java-interop@daec07b6: [build] Fix various warnings (dotnet#812)
  * dotnet/java-interop@678c4bd2: [class-parse, generator] Allow showing Kotlin internals via metadata (dotnet#793)
  * dotnet/java-interop@cd4c8f80: [jnienv-gen] Generate a header file for the native functions (dotnet#809)
  * dotnet/java-interop@69767c1a: [param-name-importer] Fix NSE when updating JavaApi.AllPackages (dotnet#807)
  * dotnet/java-interop@a666a6f9: [Java.Runtime.Environment] Partial support for .NET Core (dotnet#804)

Note: dotnet/java-interop@3824b974 updated
Java.Interop/src/java-interop to use `_WINDOWS`, not `WINDOWS`.
Define `_WINDOWS` when building for Windows as well.
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Mar 18, 2021
Fixes: dotnet/java-interop#790

Changes: dotnet/java-interop@bba1f07...3824b97

  * dotnet/java-interop@3824b974: [java-interop] Windows build system support (dotnet#816)
  * dotnet/java-interop@94c0c709: Bump to xamarin/xamarin-android-tools/main@554d45a (dotnet#813)
  * dotnet/java-interop@5c756b14: [Java.Interop-PerformanceTests] Support .NET Core 3.1 (dotnet#808)
  * dotnet/java-interop@daec07b6: [build] Fix various warnings (dotnet#812)
  * dotnet/java-interop@678c4bd2: [class-parse, generator] Allow showing Kotlin internals via metadata (dotnet#793)
  * dotnet/java-interop@cd4c8f80: [jnienv-gen] Generate a header file for the native functions (dotnet#809)
  * dotnet/java-interop@69767c1a: [param-name-importer] Fix NSE when updating JavaApi.AllPackages (dotnet#807)
  * dotnet/java-interop@a666a6f9: [Java.Runtime.Environment] Partial support for .NET Core (dotnet#804)

Note: dotnet/java-interop@3824b974 updated
Java.Interop/src/java-interop to use `_WINDOWS`, not `WINDOWS`.
Define `_WINDOWS` when building for Windows as well.
jonpryor added a commit that referenced this pull request Mar 23, 2021
Fixes: dotnet/java-interop#790

Changes: dotnet/java-interop@bba1f07...a3de91e

  * dotnet/java-interop@a3de91ef: [ci] Make VC++ toolchain optional (#820)
  * dotnet/java-interop@3824b974: [java-interop] Windows build system support (#816)
  * dotnet/java-interop@94c0c709: Bump to xamarin/xamarin-android-tools/main@554d45a (#813)
  * dotnet/java-interop@5c756b14: [Java.Interop-PerformanceTests] Support .NET Core 3.1 (#808)
  * dotnet/java-interop@daec07b6: [build] Fix various warnings (#812)
  * dotnet/java-interop@678c4bd2: [class-parse, generator] Allow showing Kotlin internals via metadata (#793)
  * dotnet/java-interop@cd4c8f80: [jnienv-gen] Generate a header file for the native functions (#809)
  * dotnet/java-interop@69767c1a: [param-name-importer] Fix NSE when updating JavaApi.AllPackages (#807)
  * dotnet/java-interop@a666a6f9: [Java.Runtime.Environment] Partial support for .NET Core (#804)

Note: dotnet/java-interop@3824b974 updated
Java.Interop/src/java-interop to use `_WINDOWS`, not `WINDOWS`.
Define `_WINDOWS` when building for Windows as well.
@github-actions github-actions bot locked and limited conversation to collaborators Feb 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants