blob: 47affba8ad8874f92b04b9f9d21c6cfd6fdbce18 [file] [log] [blame]
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'clone-artifacts'
def toolingApiVersion = gradle.gradleVersion
// Custom config that cloneArtifact will not look into, since this
// artifact is not in mavenCentral, but in the gradle repo instead.
configurations{
gradleRepo
}
dependencies {
// should be build-model but until builder is in a repo w/o it's local dependencies, we have to
// depend on builder itself to not have a dependency on 'common'
//compile project(':builder-model')
compile project(':builder')
testCompile 'junit:junit:3.8.1'
// Need an SLF4J implementation at runtime
testRuntime 'org.slf4j:slf4j-simple:1.7.2'
// this is technically testCompile, but we don't want
// it in there to avoid breaking cloneArtifact.
// we'll add it to the test compile classpath manually below
gradleRepo "org.gradle:gradle-tooling-api:${toolingApiVersion}"
}
//Include custom for compilation
sourceSets.test.compileClasspath += configurations.gradleRepo
sourceSets.test.runtimeClasspath += configurations.gradleRepo
def getVersion() {
if (project.has("release")) {
return project.ext.baseVersion
}
return project.ext.baseVersion + '-SNAPSHOT'
}
test.dependsOn ':gradle:publishLocal'
version = getVersion()
archivesBaseName = 'gradle-model'
task publishLocal(type: Upload) {
configuration = configurations.archives
repositories {
mavenDeployer {
repository(url: uri("$rootDir/repo"))
}
}
}
// custom tasks for creating source/javadoc jars
task sourcesJar(type: Jar, dependsOn:classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
javadoc {
exclude "**/internal/**"
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
title "Android Model"
}
task javadocJar(type: Jar, dependsOn:javadoc) {
classifier 'javadoc'
from javadoc.destinationDir
}
// add javadoc/source jar tasks as artifacts
artifacts {
archives jar
archives sourcesJar
archives javadocJar
}