-
-
Save creativepsyco/10664971 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| buildscript { | |
| repositories { | |
| // rather than hit central each time with this: | |
| // mavenCentral() | |
| // we hit our company Nexus server ont he public group | |
| // which includes the Central Repository | |
| // and is local, so more performant | |
| maven { | |
| url "http://localhost:8081/nexus/content/groups/public" | |
| } | |
| } | |
| dependencies { | |
| classpath 'com.android.tools.build:gradle:0.4.2' | |
| } | |
| } | |
| apply plugin: 'maven' | |
| repositories { | |
| // we also hit Nexus for all other dependencies! | |
| maven { | |
| url 'http://localhost:8081/nexus/content/groups/public' | |
| } | |
| } | |
| uploadArchives { | |
| repositories { | |
| // the maven plugin features this deployer | |
| mavenDeployer { | |
| // we deploy to the release repository in this case | |
| repository(url: "http://localhost:8081/nexus/content/repositories/releases") { | |
| authentication(userName: 'admin', password: 'admin123gi') | |
| } | |
| } | |
| } | |
| } | |
| android { | |
| .... | |
| } |
This file contains hidden or 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
| ////////////// | |
| // NDK Support | |
| ////////////// | |
| task copyNativeLibs(type: Copy) { | |
| dependsOn 'buildNative' | |
| from(new File('libs')) { include '**/*.so' } | |
| into new File(buildDir, 'native-libs') | |
| } | |
| tasks.withType(Compile) { compileTask -> compileTask.dependsOn copyNativeLibs } | |
| clean.dependsOn 'cleanCopyNativeLibs' | |
| tasks.withType(com.android.build.gradle.tasks.PackageApplication) { pkgTask -> | |
| pkgTask.jniDir new File(buildDir, 'native-libs') | |
| } | |
| task buildNative(type: Exec) { | |
| if (System.env.ANDROID_NDK_HOME != null) { | |
| def ndkBuild = new File(System.env.ANDROID_NDK_HOME, 'ndk-build') | |
| commandLine ndkBuild | |
| } else { | |
| doLast { | |
| println '##################' | |
| println 'Skipping NDK build' | |
| println 'Reason: ANDROID_NDK_HOME not set.' | |
| println '##################' | |
| } | |
| } | |
| } |
This file contains hidden or 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
| signingConfigs { | |
| release { | |
| def env = System.getenv() | |
| if (env['GRADLE_KEYSTORE_FILE'] != null) { | |
| storeFile file(env['GRADLE_KEYSTORE_FILE']) | |
| storePassword env['GRADLE_KEYSTORE_PASSWORD'] | |
| keyAlias env['GRADLE_KEYSTORE_KEY_ALIAS'] | |
| keyPassword env['GRADLE_KEYSTORE_KEY_PASSWORD'] | |
| } else { | |
| println ("##################") | |
| println ("No keystore for release set.") | |
| println ("Set GRADLE_KEYSTORE_FILE, GRADLE_KEYSTORE_PASSWORD," | |
| + "GRADLE_KEYSTORE_KEY_ALIAS and GRADLE_KEYSTORE_KEY_PASSWORD") | |
| println ("##################") | |
| } | |
| } | |
| } |
This file contains hidden or 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
| task spoon(type: JavaExec, dependsOn: ["assembleDebug", "assembleTest"]) { | |
| main = "-jar" | |
| args relativePath("../spoon-runner-1.0.6-SNAPSHOT-jar-with-dependencies.jar") | |
| args "--apk" | |
| args relativePath("build/apk/sample-app-debug-unaligned.apk") | |
| args "--test-apk" | |
| args relativePath("build/apk/sample-app-test-unaligned.apk") | |
| args "--output" | |
| args "build/spoon" | |
| logger.info "main=${main},classpath=${classpath},args=${args}" | |
| } |
This file contains hidden or 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
| // UTF-8 | |
| tasks.withType(Compile) { | |
| options.encoding = 'UTF-8' | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment