Created
April 9, 2019 16:58
-
-
Save jonathanpeppers/81d4af91502158d74a137bf3e4db868e to your computer and use it in GitHub Desktop.
Example of building Xamarin.Android java sources with gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I put this in obj\Debug\android\build.gradle | |
// Ran `gradlew assemble` -> 'build\libs\classes.jar` | |
// Unfortunately this took 2s with gradle, compared to 569ms with just javac | |
plugins { | |
id 'java' | |
} | |
sourceSets { | |
main { | |
java { | |
srcDirs = ['src'] | |
} | |
} | |
} | |
dependencies { | |
implementation files( | |
'C:/src/xamarin-android/bin/Debug/lib/xamarin.android/xbuild-frameworks/MonoAndroid/v9.0/mono.android.jar', | |
'C:/src/xamarin-android/bin/Debug/lib/xamarin.android/xbuild/Xamarin/Android/java_runtime.jar', | |
) | |
compileOnly files( | |
'C:/Users/jopepper/android-toolchain/sdk/platforms/android-28/android.jar', | |
) | |
} | |
jar { | |
archiveName 'classes.jar' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment