Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
57 lines (46 sloc) 1.3 KB
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'idea'
defaultTasks 'deploy'
// Including Ant build from a separate Gradle file to avoid clashes with
// existing targets e.g. clean, etc. from java plugin
task importTasksRunInOrder(type: GradleBuild) { GradleBuild antBuild ->
antBuild.buildFile ='buildWithClean.gradle'
antBuild.tasks = ['jar']
}
version = '1.0-SNAPSHOT'
group = 'org.annares.lzo'
repositories {
mavenLocal()
}
task rename (type: Copy) {
from 'dist'
into project.libsDir
rename { String fileName ->
fileName.replaceAll('lzo', project.name + "-" + version)
}
rename '(lzo)(.jar)', '$2'
}
jar.onlyIf {"Ant build provided jar will be moved in place".length() == 0}
task deploy (dependsOn: [importTasksRunInOrder, rename, uploadArchives]) << {
println 'Buidling and deploying'
}
uploadArchives {
repositories {
mavenDeployer {
repository(url: "http://archiva:8290/archiva/repository/snapshots/") {
// Make sure to have correctly configured user/password in
// ~/.m2/settings.xml to access the repository above
}
pom.project {
inceptionYear '2011'
licenses {
license {
name 'GNU GENERAL PUBLIC LICENSE Version 3'
distribution 'repo'
}
}
}
}
}
}