apply plugin: 'java'
apply plugin: 'maven-publish'

group = 'org.rehlds.flightrec'
version = rootProject.version

sourceCompatibility = '1.7'
targetCompatibility = '1.7'

repositories {
    mavenCentral()
}

dependencies {
    testCompile "junit:junit:4.12"
}

publishing {
    publications {
        maven(MavenPublication) {
            version project.version
            artifactId 'decoder-api'
            artifact jar

            pom.withXml {
                asNode().children().last() + {
                    resolveStrategy = DELEGATE_FIRST
                    name 'decoder-api'
                    description project.description
                    //url github
                    //scm {
                    //    url "${github}.git"
                    //    connection "scm:git:${github}.git"
                    //}
                    /*
                    licenses {
                        license {
                            name 'The Apache Software License, Version 2.0'
                            url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
                            distribution 'repo'
                        }
                    }
                    developers {
                        developer {
                            id 'dreamstalker'
                            name 'dreamstalker'
                        }
                    }
                    */
                }
            }
        }
    }
}

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) {
    options.encoding = 'UTF-8'
}