From 3052c7034b09b396c2f480bbeb1ef634681b3d69 Mon Sep 17 00:00:00 2001 From: Adam Murdoch Date: Sun, 16 Sep 2012 13:48:54 +1000 Subject: [PATCH] Some changes to artifact uploads. --- build.gradle | 23 ++++++++++++++++------- readme.md | 4 ++-- test-app/build.gradle | 2 +- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index 5f09f43..8027d13 100755 --- a/build.gradle +++ b/build.gradle @@ -8,6 +8,7 @@ allprojects { repositories { mavenCentral() + maven { url "https://gradle.artifactoryonline.com/gradle/libs-releases-local" } } dependencies { @@ -22,10 +23,16 @@ allprojects { configurations.compile.extendsFrom = [] - uploadArchives { + tasks.withType(Upload) { repositories { mavenDeployer { - repository(url: uri("$rootProject.buildDir/repo")) + if (project.hasProperty('release')) { + repository(url: uri("https://gradle.artifactoryonline.com/gradle/libs-releases-local")) { + authentication(userName: artifactoryUserName, password: artifactoryPassword) + } + } else { + repository(url: uri("$rootProject.buildDir/repo")) + } } } } @@ -135,7 +142,11 @@ task nativeHeaders { } } -def deployer = uploadArchives.repositories.mavenDeployer +configurations { + jni +} + +def deployer = uploadJni.repositories.mavenDeployer libraries.all { lib -> def nativeJar = task("nativeJar${lib.name.capitalize()}", type: Jar) { @@ -145,7 +156,7 @@ libraries.all { lib -> lib.spec.task.dependsOn nativeHeaders test.dependsOn lib.spec.task artifacts { - archives nativeJar + jni nativeJar runtime nativeJar } def jniPom = deployer.addFilter(lib.name) { artifact, file -> @@ -161,9 +172,7 @@ javadoc { exclude '**/internal/**' } -def mainPom = deployer.addFilter('main') { artifact, file -> - return file == jar.archivePath -} +def mainPom = uploadArchives.repositories.mavenDeployer.pom mainPom.groupId = project.group mainPom.artifactId = jar.baseName mainPom.version = project.version diff --git a/readme.md b/readme.md index dce081d..d75f318 100755 --- a/readme.md +++ b/readme.md @@ -107,12 +107,12 @@ You can run `$INSTALL_DIR/bin/native-platform-test` to run the test application. 1. Create a tag. 2. Build each variant: - * OS X universal + * OS X universal: `./gradlew clean :uploadJni -Prelease -PartifactoryUserName=<> -PartifactoryPassword=<>` * Linux i386 * Linux amd64 * Windows x86 * Windows x64 -3. Build Java library and test app. +3. Build Java library and test app `./gradlew clean :uploadArchives testApp:uploadArchives -Prelease` ## Testing diff --git a/test-app/build.gradle b/test-app/build.gradle index d31caf9..a341b78 100644 --- a/test-app/build.gradle +++ b/test-app/build.gradle @@ -4,7 +4,7 @@ mainClassName = 'net.rubygrapefruit.platform.test.Main' applicationName = 'native-platform-test' archivesBaseName = 'native-platform-test' -if (project.hasProperty('remote-artifacts')) { +if (project.hasProperty('release')) { repositories { maven { url "$rootProject.buildDir/repo" } }