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 { repositories {
mavenCentral() mavenCentral()
maven { url "https://gradle.artifactoryonline.com/gradle/libs-releases-local" }
} }
dependencies { dependencies {
@@ -22,10 +23,16 @@ allprojects {
configurations.compile.extendsFrom = [] configurations.compile.extendsFrom = []
uploadArchives { tasks.withType(Upload) {
repositories { repositories {
mavenDeployer { 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 -> libraries.all { lib ->
def nativeJar = task("nativeJar${lib.name.capitalize()}", type: Jar) { def nativeJar = task("nativeJar${lib.name.capitalize()}", type: Jar) {
@@ -145,7 +156,7 @@ libraries.all { lib ->
lib.spec.task.dependsOn nativeHeaders lib.spec.task.dependsOn nativeHeaders
test.dependsOn lib.spec.task test.dependsOn lib.spec.task
artifacts { artifacts {
archives nativeJar jni nativeJar
runtime nativeJar runtime nativeJar
} }
def jniPom = deployer.addFilter(lib.name) { artifact, file -> def jniPom = deployer.addFilter(lib.name) { artifact, file ->
@@ -161,9 +172,7 @@ javadoc {
exclude '**/internal/**' exclude '**/internal/**'
} }
def mainPom = deployer.addFilter('main') { artifact, file -> def mainPom = uploadArchives.repositories.mavenDeployer.pom
return file == jar.archivePath
}
mainPom.groupId = project.group mainPom.groupId = project.group
mainPom.artifactId = jar.baseName mainPom.artifactId = jar.baseName
mainPom.version = project.version 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. 1. Create a tag.
2. Build each variant: 2. Build each variant:
* OS X universal * OS X universal: `./gradlew clean :uploadJni -Prelease -PartifactoryUserName=<> -PartifactoryPassword=<>`
* Linux i386 * Linux i386
* Linux amd64 * Linux amd64
* Windows x86 * Windows x86
* Windows x64 * Windows x64
3. Build Java library and test app. 3. Build Java library and test app `./gradlew clean :uploadArchives testApp:uploadArchives -Prelease`
## Testing ## Testing

View File

@@ -4,7 +4,7 @@ mainClassName = 'net.rubygrapefruit.platform.test.Main'
applicationName = 'native-platform-test' applicationName = 'native-platform-test'
archivesBaseName = 'native-platform-test' archivesBaseName = 'native-platform-test'
if (project.hasProperty('remote-artifacts')) { if (project.hasProperty('release')) {
repositories { repositories {
maven { url "$rootProject.buildDir/repo" } maven { url "$rootProject.buildDir/repo" }
} }