79 lines
2.0 KiB
Groovy
79 lines
2.0 KiB
Groovy
buildscript {
|
|
repositories {
|
|
maven { url 'http://nexus.red-soft.biz/nexus/content/groups/public' }
|
|
}
|
|
dependencies {
|
|
classpath 'biz.redsoft.gradle.ncore:gradle-ncore:+'
|
|
}
|
|
}
|
|
|
|
group = 'biz.redsoft.sample'
|
|
|
|
apply plugin: 'application'
|
|
apply plugin: 'war'
|
|
apply plugin: 'ncore'
|
|
apply plugin: 'maven-publish'
|
|
|
|
|
|
targetCompatibility = 1.6
|
|
|
|
ncore {
|
|
coreVersion = '1.3.6.1'
|
|
sourceEncoding = 'UTF-8'
|
|
}
|
|
|
|
dependencies {
|
|
provided 'javax.servlet:javax.servlet-api:3.0.1'
|
|
|
|
testCompile 'junit:junit:4.+'
|
|
}
|
|
|
|
run.args = ['client',
|
|
'-config', 'ncore-properties.xml',
|
|
'-config', 'ncore-properties-local.xml']
|
|
|
|
publishing {
|
|
repositories {
|
|
project.hasProperty('biz.redsoft.repo.user') && project.hasProperty('biz.redsoft.repo.password') && maven {
|
|
credentials {
|
|
username project.'biz.redsoft.repo.user'
|
|
password project.'biz.redsoft.repo.password'
|
|
}
|
|
def suffix = project.version.toString().endsWith('SNAPSHOT') ? 'snapshots' : 'releases'
|
|
url "http://nexus.red-soft.biz/nexus/content/repositories/${suffix}"
|
|
}
|
|
}
|
|
publications {
|
|
mavenJava(MavenPublication) {
|
|
from components.java
|
|
|
|
artifact sourceJar
|
|
artifact updatesJar
|
|
}
|
|
mavenJavaGen(MavenPublication) {
|
|
artifactId "${genJar.baseName}-${genJar.appendix}"
|
|
artifact genJar
|
|
artifact genSourceJar
|
|
}
|
|
}
|
|
}
|
|
|
|
task copyDist(type: Copy) {
|
|
from distZip
|
|
from war
|
|
def releaseDir
|
|
if (project.hasProperty('biz.redsoft.release.dir') && project.getProperty('biz.redsoft.release.dir'))
|
|
releaseDir = "${project.getProperty('biz.redsoft.release.dir')}"
|
|
else
|
|
releaseDir = "$projectDir/../releases"
|
|
into "$releaseDir/$project.name/$version"
|
|
}
|
|
|
|
release {
|
|
tagPrefix = 'v'
|
|
}
|
|
|
|
task buildRelease(type: GradleBuild) {
|
|
tasks = ['clean', 'writeVersion', 'nbackup', 'build', 'copyDist', 'publish']
|
|
}
|