Переезд на новый градл
This commit is contained in:
88
build.gradle
88
build.gradle
@ -1,22 +1,13 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
maven { url 'https://ncore-repo.red-soft.ru/repository/public' }
|
||||
mavenLocal()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'biz.redsoft.gradle.ncore:gradle-ncore:1.3.+'
|
||||
classpath 'nu.studer:gradle-credentials-plugin:1.0.7'
|
||||
}
|
||||
plugins {
|
||||
id 'nu.studer.credentials' version('1.0.4')
|
||||
id 'idea'
|
||||
id 'eclipse'
|
||||
id 'application'
|
||||
id 'java-library'
|
||||
id 'war'
|
||||
id 'gradle-ncore' version('3.0.65')
|
||||
}
|
||||
|
||||
group = 'biz.redsoft.sample'
|
||||
|
||||
apply plugin: 'nu.studer.credentials'
|
||||
apply plugin: 'idea'
|
||||
apply plugin: 'application'
|
||||
apply plugin: 'war'
|
||||
apply plugin: 'ncore'
|
||||
|
||||
apply from: "dependencies.gradle"
|
||||
|
||||
targetCompatibility = 1.8
|
||||
@ -27,26 +18,27 @@ ncore {
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
maven {
|
||||
url 'https://ncore-repo.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'
|
||||
testCompileClasspath 'org.junit.jupiter:junit-jupiter:5.8.2'
|
||||
testImplementation 'org.apache.tomcat.embed:tomcat-embed-core:9.0.76'
|
||||
testImplementation 'org.apache.tomcat.embed:tomcat-embed-jasper:9.0.76'
|
||||
runtimeClasspath files(ncoreGenerateControlDataJar)
|
||||
runtimeClasspath files(genJar)
|
||||
}
|
||||
|
||||
|
||||
// writing build process to a log file
|
||||
// --------------------- BUILD LOG SETTINGS ----------------------
|
||||
def tstamp = new Date().format('yyyy-MM-dd_HH-mm-ss')
|
||||
@ -54,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
|
||||
}
|
||||
@ -86,15 +82,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{
|
||||
@ -105,6 +124,13 @@ jar{
|
||||
}
|
||||
}
|
||||
|
||||
startScripts{
|
||||
startScripts {
|
||||
project.startScripts.defaultJvmOpts = ['-Dlogback.configurationFile=./config/logback.xml']
|
||||
}
|
||||
|
||||
distTar {
|
||||
duplicatesStrategy = DuplicatesStrategy.WARN
|
||||
}
|
||||
distZip {
|
||||
duplicatesStrategy = DuplicatesStrategy.WARN
|
||||
}
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
|
||||
|
@ -1 +1,7 @@
|
||||
pluginManagement{
|
||||
repositories {
|
||||
maven { url 'https://ncore-repo.red-soft.ru/repository/public' }
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = 'sample'
|
@ -1,4 +1,4 @@
|
||||
{
|
||||
"dependencies": [],
|
||||
"register": {}
|
||||
}
|
||||
"dependencies" : [ ],
|
||||
"register" : { }
|
||||
}
|
Reference in New Issue
Block a user