forked from fortify/fcli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
63 lines (57 loc) · 1.75 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
plugins {
id('com.github.jk1.dependency-license-report') version '2.5' apply false
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
id "org.asciidoctor.jvm.convert" version "3.3.2" apply false
id "io.freefair.lombok" version "8.1.0" apply false
}
group = "com.fortify.cli"
ext {
buildTime = LocalDateTime.now()
getVersion = {
def result = project.findProperty('version');
return !result || result=='unspecified' ? buildTime.format('0.yyyyMMdd.HHmmss') : result;
}
}
allprojects {
apply plugin: 'eclipse'
version = rootProject.ext.getVersion();
ext {
distDir = "${rootProject.buildDir}/dist"
releaseAssetsDir = "${distDir}/release-assets"
sharedGradleScriptsDir = "${rootDir}/$sharedGradleScriptsRelativeDir"
gradleHelpersLocation = "https://raw.githubusercontent.com/fortify/shared-gradle-helpers/1.8"
}
// Define *RefDir properties for each *Ref property defined in gradle.properties,
// based on the refPatterns property defined in the same gradle.properties
properties.each { p->
if ( "$refPatterns".split(',').any { p.key.matches(it) } ) {
ext[p.key+"Dir"] = "$rootDir" + p.value.replaceAll(':', '/')
}
}
// Define Maven Central repository
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
task createDistDir {
doFirst {
mkdir "${distDir}"
mkdir "${releaseAssetsDir}"
}
}
}
task clean(type: Delete) {
delete "build"
}
task build(type: Copy) {
dependsOn("${fcliAppRef}:build")
from "${fcliAppRefDir}/build/libs/fcli.jar"
into "build/libs"
}
task dist(type: Copy) {
dependsOn(createDistDir)
from("${projectDir}") {
include "LICENSE.txt"
}
into "${releaseAssetsDir}"
}