New branch
This commit is contained in:
88
build.gradle
88
build.gradle
@ -1,22 +1,15 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
maven { url 'http://nexus.red-soft.biz/repository/public' }
|
||||
mavenLocal()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'biz.redsoft.gradle.ncore:gradle-ncore:1.2.+'
|
||||
classpath 'nu.studer:gradle-credentials-plugin:1.0.4'
|
||||
}
|
||||
plugins {
|
||||
id 'nu.studer.credentials' version('1.0.4')
|
||||
id 'idea'
|
||||
id 'eclipse'
|
||||
id 'application'
|
||||
id 'java-library'
|
||||
id 'war'
|
||||
id 'gradle-ncore' version('2.9.+')
|
||||
}
|
||||
|
||||
group = 'biz.redsoft.sample'
|
||||
|
||||
apply plugin: 'nu.studer.credentials'
|
||||
apply plugin: 'idea'
|
||||
apply plugin: 'application'
|
||||
apply plugin: 'war'
|
||||
apply plugin: 'ncore'
|
||||
|
||||
targetCompatibility = 1.8
|
||||
|
||||
ncore {
|
||||
@ -27,22 +20,23 @@ ncore {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
maven {
|
||||
url 'http://nexus.red-soft.biz/repository/public'
|
||||
url 'https://nexus.red-soft.ru/repository/public'
|
||||
if (project.credentials.user != null && project.credentials.password != null) {
|
||||
credentials {
|
||||
username project.credentials.user
|
||||
password project.credentials.password
|
||||
}
|
||||
credentials {
|
||||
username project.credentials.user
|
||||
password project.credentials.password
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
provided 'javax.servlet:javax.servlet-api:3.1.0'
|
||||
|
||||
testCompile 'org.junit.jupiter:junit-jupiter:5.8.2'
|
||||
implementation 'javax.servlet:javax.servlet-api:3.1.0'
|
||||
implementation 'biz.redsoft.gradle.ncore:gradle-ncore:2.9.+'
|
||||
testCompileClasspath 'org.junit.jupiter:junit-jupiter:5.8.2'
|
||||
runtimeClasspath files(ncoreGenerateControlDataJar)
|
||||
runtimeClasspath files(genJar)
|
||||
annotationProcessor 'biz.redsoft.ncore:ncoreAnnotationProcessor:1.0.+'
|
||||
}
|
||||
|
||||
// writing build process to a log file
|
||||
@ -52,16 +46,20 @@ def buildLogDir = "${rootDir}/logs"
|
||||
mkdir("${buildLogDir}")
|
||||
def buildLog = new File("${buildLogDir}/${tstamp}_buildLog.log")
|
||||
|
||||
import org.gradle.internal.logging.*
|
||||
|
||||
import org.gradle.internal.logging.LoggingOutputInternal
|
||||
|
||||
import java.util.regex.Matcher
|
||||
|
||||
System.setProperty('org.gradle.color.error', 'RED')
|
||||
|
||||
gradle.services.get(LoggingOutputInternal).addStandardOutputListener (new StandardOutputListener () {
|
||||
gradle.services.get(LoggingOutputInternal).addStandardOutputListener(new StandardOutputListener() {
|
||||
void onOutput(CharSequence output) {
|
||||
buildLog << output
|
||||
}
|
||||
})
|
||||
|
||||
gradle.services.get(LoggingOutputInternal).addStandardErrorListener (new StandardOutputListener () {
|
||||
gradle.services.get(LoggingOutputInternal).addStandardErrorListener(new StandardOutputListener() {
|
||||
void onOutput(CharSequence output) {
|
||||
buildLog << output
|
||||
}
|
||||
@ -83,15 +81,38 @@ task copyDist(type: Copy) {
|
||||
into "$releaseDir/$project.name/$version"
|
||||
}
|
||||
|
||||
def versionPropertiesFilePath = sourceSets.main.resources.srcDirs[0].toString() + File.separator + "META-INF/ncore-product/${project.group}/version.properties"
|
||||
|
||||
release {
|
||||
tagPrefix = 'v'
|
||||
commitNewVersion.enabled(true)
|
||||
failOnCommitNeeded = false
|
||||
failOnPublishNeeded = true
|
||||
failOnSnapshotDependencies = true
|
||||
failOnUnversionedFiles = false
|
||||
failOnUpdateNeeded = false
|
||||
revertOnFail = true
|
||||
preCommitText = ''
|
||||
preTagCommitMessage = '[Gradle Release Plugin] - pre tag commit: '
|
||||
tagCommitMessage = '[Gradle Release Plugin] - creating tag: '
|
||||
newVersionCommitMessage = '[Gradle Release Plugin] - new version commit: '
|
||||
tagTemplate = "${project.name}/v${version}"
|
||||
versionPropertyFile = versionPropertiesFilePath
|
||||
versionProperties = []
|
||||
snapshotSuffix = '-SNAPSHOT'
|
||||
buildTasks = ['buildRelease', 'commitNewVersion']
|
||||
ignoredSnapshotDependencies = []
|
||||
versionPatterns = [
|
||||
/(\d+)(\.)(\d+)(\.)(\d+)([^\d]*\u0024)/: { Matcher m, Project p ->
|
||||
project.getVersion().newVersion().toString()
|
||||
}
|
||||
]
|
||||
pushReleaseVersionBranch = null
|
||||
}
|
||||
|
||||
task buildRelease(type: GradleBuild) {
|
||||
tasks = ['clean', 'writeVersion', 'nbackup', 'build', 'copyDist', 'publish']
|
||||
}
|
||||
|
||||
idea { module.scopes.PROVIDED.plus += [configurations.provided] }
|
||||
|
||||
jar{
|
||||
manifest{
|
||||
@ -102,6 +123,13 @@ jar{
|
||||
}
|
||||
}
|
||||
|
||||
startScripts{
|
||||
startScripts {
|
||||
project.startScripts.defaultJvmOpts = ['-Dlogback.configurationFile=./config/logback.xml']
|
||||
}
|
||||
}
|
||||
|
||||
distTar {
|
||||
duplicatesStrategy = DuplicatesStrategy.WARN
|
||||
}
|
||||
distZip {
|
||||
duplicatesStrategy = DuplicatesStrategy.WARN
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user