2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-02-27 14:01:18 +03:00

Publish flightdecoder API to maven repo

This commit is contained in:
dreamstalker 2015-06-06 21:50:56 +04:00
parent 76b017901b
commit 80692e3821
3 changed files with 21 additions and 1 deletions

View File

@ -1,6 +1,7 @@
apply plugin: 'java' apply plugin: 'java'
group = 'org.rehlds.flightrec' group = 'org.rehlds.flightrec'
version = rootProject.version
sourceCompatibility = '1.7' sourceCompatibility = '1.7'
targetCompatibility = '1.7' targetCompatibility = '1.7'

View File

@ -2,6 +2,7 @@ apply plugin: 'java'
apply plugin: 'maven-publish' apply plugin: 'maven-publish'
group = 'org.rehlds.flightrec' group = 'org.rehlds.flightrec'
version = rootProject.version
sourceCompatibility = '1.7' sourceCompatibility = '1.7'
targetCompatibility = '1.7' targetCompatibility = '1.7'
@ -17,7 +18,7 @@ dependencies {
publishing { publishing {
publications { publications {
maven(MavenPublication) { maven(MavenPublication) {
version rootProject.version version project.version
artifactId 'decoder-api' artifactId 'decoder-api'
artifact jar artifact jar
@ -52,6 +53,22 @@ publishing {
} }
} }
publishing {
repositories {
maven {
if (project.version.contains('SNAPSHOT')) {
url "http://nexus.rehlds.org/nexus/content/repositories/rehlds-snapshots/"
} else {
url "http://nexus.rehlds.org/nexus/content/repositories/rehlds-releases/"
}
credentials {
username rootProject.repoCreds.getProperty('username')
password rootProject.repoCreds.getProperty('password')
}
}
}
}
tasks.withType(AbstractCompile) { tasks.withType(AbstractCompile) {
options.encoding = 'UTF-8' options.encoding = 'UTF-8'
} }

View File

@ -120,6 +120,7 @@ publishing {
} }
Properties repoCreds = new Properties() Properties repoCreds = new Properties()
project.ext.repoCreds = repoCreds
if (file('repo_creds.properties').exists()) { if (file('repo_creds.properties').exists()) {
println 'Loading maven repo credentials' println 'Loading maven repo credentials'
file('repo_creds.properties').withReader('UTF-8', { Reader r -> file('repo_creds.properties').withReader('UTF-8', { Reader r ->
@ -147,5 +148,6 @@ task doPublish {
dependsOn 'publishPackage' dependsOn 'publishPackage'
if (repoCreds.getProperty('username') && repoCreds.getProperty('password')) { if (repoCreds.getProperty('username') && repoCreds.getProperty('password')) {
dependsOn 'publish' dependsOn 'publish'
dependsOn ':flightrec/decoder_api:publish'
} }
} }