Переезд на новый градл
This commit is contained in:
80
build.gradle
80
build.gradle
@ -1,22 +1,13 @@
|
|||||||
buildscript {
|
plugins {
|
||||||
repositories {
|
id 'nu.studer.credentials' version('1.0.4')
|
||||||
maven { url 'https://ncore-repo.red-soft.ru/repository/public' }
|
id 'idea'
|
||||||
mavenLocal()
|
id 'eclipse'
|
||||||
}
|
id 'application'
|
||||||
dependencies {
|
id 'java-library'
|
||||||
classpath 'biz.redsoft.gradle.ncore:gradle-ncore:1.3.+'
|
id 'war'
|
||||||
classpath 'nu.studer:gradle-credentials-plugin:1.0.7'
|
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"
|
apply from: "dependencies.gradle"
|
||||||
|
|
||||||
targetCompatibility = 1.8
|
targetCompatibility = 1.8
|
||||||
@ -27,7 +18,6 @@ ncore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
|
||||||
maven {
|
maven {
|
||||||
url 'https://ncore-repo.red-soft.ru/repository/public'
|
url 'https://ncore-repo.red-soft.ru/repository/public'
|
||||||
if (project.credentials.user != null && project.credentials.password != null) {
|
if (project.credentials.user != null && project.credentials.password != null) {
|
||||||
@ -40,13 +30,15 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
provided 'javax.servlet:javax.servlet-api:3.1.0'
|
implementation 'javax.servlet:javax.servlet-api:3.1.0'
|
||||||
|
testCompileClasspath 'org.junit.jupiter:junit-jupiter:5.8.2'
|
||||||
testCompile '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(ncoreGenerateControlDataJar)
|
||||||
runtimeClasspath files(genJar)
|
runtimeClasspath files(genJar)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// writing build process to a log file
|
// writing build process to a log file
|
||||||
// --------------------- BUILD LOG SETTINGS ----------------------
|
// --------------------- BUILD LOG SETTINGS ----------------------
|
||||||
def tstamp = new Date().format('yyyy-MM-dd_HH-mm-ss')
|
def tstamp = new Date().format('yyyy-MM-dd_HH-mm-ss')
|
||||||
@ -54,16 +46,20 @@ def buildLogDir = "${rootDir}/logs"
|
|||||||
mkdir("${buildLogDir}")
|
mkdir("${buildLogDir}")
|
||||||
def buildLog = new File("${buildLogDir}/${tstamp}_buildLog.log")
|
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')
|
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) {
|
void onOutput(CharSequence output) {
|
||||||
buildLog << output
|
buildLog << output
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
gradle.services.get(LoggingOutputInternal).addStandardErrorListener (new StandardOutputListener () {
|
gradle.services.get(LoggingOutputInternal).addStandardErrorListener(new StandardOutputListener() {
|
||||||
void onOutput(CharSequence output) {
|
void onOutput(CharSequence output) {
|
||||||
buildLog << output
|
buildLog << output
|
||||||
}
|
}
|
||||||
@ -86,15 +82,38 @@ task copyDist(type: Copy) {
|
|||||||
into "$releaseDir/$project.name/$version"
|
into "$releaseDir/$project.name/$version"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def versionPropertiesFilePath = sourceSets.main.resources.srcDirs[0].toString() + File.separator + "META-INF/ncore-product/${project.group}/version.properties"
|
||||||
|
|
||||||
release {
|
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) {
|
task buildRelease(type: GradleBuild) {
|
||||||
tasks = ['clean', 'writeVersion', 'nbackup', 'build', 'copyDist', 'publish']
|
tasks = ['clean', 'writeVersion', 'nbackup', 'build', 'copyDist', 'publish']
|
||||||
}
|
}
|
||||||
|
|
||||||
idea { module.scopes.PROVIDED.plus += [configurations.provided] }
|
|
||||||
|
|
||||||
jar{
|
jar{
|
||||||
manifest{
|
manifest{
|
||||||
@ -105,6 +124,13 @@ jar{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
startScripts{
|
startScripts {
|
||||||
project.startScripts.defaultJvmOpts = ['-Dlogback.configurationFile=./config/logback.xml']
|
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
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
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'
|
rootProject.name = 'sample'
|
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"dependencies": [],
|
"dependencies" : [ ],
|
||||||
"register": {}
|
"register" : { }
|
||||||
}
|
}
|
Reference in New Issue
Block a user