Some changes to artifact uploads.

This commit is contained in:
Adam Murdoch
2012-09-16 13:48:54 +10:00
parent 1fd7726ec1
commit 3052c7034b
3 changed files with 19 additions and 10 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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" }
}