-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
137 lines (102 loc) · 3.74 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/*
To make release and increase version:
gradle -Preckon.stage=final -Preckon.scope=patch reckonTagPush
gradle -Preckon.stage=final -Preckon.scope=minor reckonTagPush
gradle -Preckon.stage=final -Preckon.scope=major reckonTagPush
*/
plugins {
id 'application'
id 'eclipse'
//id 'org.beryx.jlink' version '2.14.0' // Unable to delete directory 'D:\git\wcd\build\jlinkbase\tmpmodinfo'
id 'org.beryx.jlink' version '2.14.0'
// id 'net.saliman.properties' version '1.5.1'
id 'com.github.ben-manes.versions' version '0.22.0'
id 'org.ajoberstar.reckon' version '0.11.0'
}
repositories {
//mavenCentral()
jcenter()
}
if(!project.hasProperty('reckon.scope')){
project.ext.'reckon.scope' = 'patch' // override default 'minor'
}
reckon {
scopeFromProp()
stageFromProp('dev', 'final')
}
import org.apache.tools.ant.filters.ReplaceTokens
import org.ajoberstar.grgit.Grgit
ext.moduleName = 'webcachedigger';
//sourceCompatibility = 1.8
//targetCompatibility = 1.8
mainClassName = 'org.sergeys.webcachedigger.ui.WebCacheDigger'
//mainClassName = "$moduleName/org.sergeys.webcachedigger.ui.WebCacheDigger"
//mainClassName = "webcachedigger/org.sergeys.webcachedigger.ui.WebCacheDigger"
//ext.repo = Grgit.open(project.file('.'))
//ext.repo = Grgit.open() // fails on 9+?
//Grgit grgit = Grgit.open(currentDir: project.rootDir) // https://github.com/ajoberstar/grgit/issues/269
// see also Grgit.open(currentDir: file('.'))
ext.repo = Grgit.open(currentDir: project.rootDir)
dependencies {
compile('eu.medsea.mimeutil:mime-util:2.1.3'){
exclude module: 'log4j'
exclude module: 'slf4j-log4j12'
}
compile 'com.h2database:h2:1.4.199'
compile 'com.mpatric:mp3agic:0.9.1'
// compile 'org.flywaydb:flyway-core:4.1.2'
compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.12.0'
compile 'org.apache.logging.log4j:log4j-core:2.12.0'
}
def val = System.getenv('USER'); // linux
if(val == null){
val = System.getenv('USERNAME'); // linux under glassfish, windows
}
def builduser = (val == null ? 'undefined' : val)
def buildhost = InetAddress.localHost.hostName
// https://github.com/gradle-guides/building-java-9-modules/blob/master/src/1-single-module/actors/build.gradle
// https://www.normansoven.com/post/building-java-9-and-10-modules-with-gradle
compileJava {
inputs.property("moduleName", moduleName)
doFirst {
options.compilerArgs = [
'--module-path', classpath.asPath,
]
classpath = files() // <2>
}
}
println 'version: ' + version.toString()
processResources {
from(sourceSets.main.resources){
include '**/settings.properties'
filter(ReplaceTokens,
tokens:[
'version.timestamp': String.format('%1$tY-%1$tm-%1$td-%1$tH-%1$tM', repo.head().date),
'version.display': String.format('%2$s - %1$te %1$tb %1$tY', repo.head().date, project.version.toString()),
'git.commit': repo.head().abbreviatedId,
'git.date': repo.head().date.toString(),
'build.date': new java.util.Date().toString(),
'version': project.version.toString(),
'build.host': builduser + '@' + buildhost
])
}
}
//mainClassName = "$moduleName/org.openjfx.MainApp"
eclipse {
classpath {
file {
whenMerged {
entries.findAll { it.properties.kind.equals('lib') }.each {
it.entryAttributes['module'] = 'true'
}
}
}
}
}
jlink {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
launcher {
name = 'wcd'
}
forceMerge('log4j-api') // https://github.com/beryx/badass-jlink-plugin/issues/14
}