-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
162 lines (146 loc) · 6.08 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
plugins {
id 'java';
id 'com.github.gmazzo.buildconfig' version '4.2.0';
}
def gitCommitSha = { ->
try {
def stdout = new ByteArrayOutputStream();
def result = project.exec {
commandLine 'git', 'describe', '--long', '--always', '--dirty', '--exclude=*', '--abbrev=8';
standardOutput = stdout;
}
if(result.getExitValue() != 0)
return "";
return stdout.toString().trim();
} catch (Exception e) {
return "";
}
}
def gitCommitShaLong = { ->
try {
def stdout = new ByteArrayOutputStream();
def result = project.exec {
commandLine 'git', 'describe','--long','--always','--exclude=*','--abbrev=40';
standardOutput = stdout;
}
if(result.getExitValue() != 0)
return "";
return stdout.toString().trim();
} catch (Exception e) {
return "";
}
}
def gitHeadName = { ->
try {
def stdout = new ByteArrayOutputStream();
def stderr = new ByteArrayOutputStream();
def result = exec {
commandLine 'git', 'describe', '--tags', '--exact-match'
standardOutput = stdout;
errorOutput = stderr;
ignoreExitValue = true;
}
if(result.exitValue == 0)
return stdout.toString().trim();
stdout.reset();
stderr.reset();
exec {
commandLine 'git', 'symbolic-ref', '-q', '--short', 'HEAD'
standardOutput = stdout;
errorOutput = stderr;
ignoreExitValue = true;
}
return stdout.toString().trim();
} catch (Exception e) {
return "HEAD";
}
}
def getVersion = { ->
def version = '1.5.0';
def headName = gitHeadName();
if(headName.equals('v'+version))
return version;
if(headName.equals('main'))
return version;
return version + '+' + gitCommitSha() + '-SNAPSHOT';
}
allprojects {
group = 'dk.gtz.graphedit';
version = getVersion();
}
// Inform IDEs about the generated code
sourceSets {
main {
java {
srcDirs 'build/generated/source/proto/main/grpc';
srcDirs 'build/generated/source/proto/main/java';
}
}
}
subprojects {
apply plugin: 'java';
apply plugin: 'com.github.gmazzo.buildconfig';
ext.gitCommitSha = gitCommitSha;
ext.gitCommitShaLong = gitCommitShaLong;
java {
sourceCompatibility = gradle.ext.javaVersion;
targetCompatibility = gradle.ext.javaVersion;
withSourcesJar()
}
buildConfig {
documentation.set("Generated by BuildConfig plugin");
buildConfigField("String", "APP_NAME", "\"${project.name}\"");
buildConfigField("String", "APP_VERSION", "\"${project.version}\"");
buildConfigField("long", "BUILD_TIME", "${System.currentTimeMillis()}L");
buildConfigField("String", "COMMIT_SHA", "\"${gitCommitSha()}\"");
buildConfigField("String", "COMMIT_SHA_LONG", "\"${gitCommitShaLong()}\"");
className("BuildConfig");
packageName("dk.gtz.graphedit");
useJavaOutput();
}
dependencies {
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.4.7';
implementation group: 'com.beust', name: 'jcommander', version: '1.82';
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.15.0';
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jdk8', version: '2.15.0';
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.15.0';
implementation group: 'dk.gtz.graphedit', name: 'graphedit-protobuf', version: '1.1.0';
implementation group: 'dk.yalibs', name: 'yadi', version: '1.1.0';
implementation group: 'dk.yalibs', name: 'yaerrors', version: '1.0.0';
implementation group: 'dk.yalibs', name: 'yafunc', version: '1.0.0';
implementation group: 'dk.yalibs', name: 'yastreamgobbler', version: '1.0.0';
implementation group: 'dk.yalibs', name: 'yaundo', version: '1.1.0';
implementation group: 'dk.yalibs', name: 'yafunc', version: '1.0.0';
implementation group: 'dk.yalibs', name: 'yalazy', version: '1.1.0';
implementation group: 'io.github.mkpaz', name: 'atlantafx-base', version: '2.0.1';
implementation group: 'org.apache.tika', name: 'tika-core', version: '2.9.0'
implementation group: 'org.fxmisc.richtext', name: 'richtextfx', version: '0.11.0'
implementation group: 'org.kordamp.ikonli', name: 'ikonli-bootstrapicons-pack', version: '12.3.1';
implementation group: 'org.kordamp.ikonli', name: 'ikonli-javafx', version: '12.3.1';
implementation group: 'org.openjfx', name: 'javafx', version: '20.0.1';
implementation group: 'org.openjfx', name: 'javafx-base', version: '20.0.1';
implementation group: 'org.openjfx', name: 'javafx-controls', version: '20.0.1';
implementation group: 'org.openjfx', name: 'javafx-fxml', version: '20.0.1';
implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.7';
implementation group: 'party.iroiro.luajava', name: 'luajava', version: '3.5.0';
implementation group: 'party.iroiro.luajava', name: 'luajit', version: '3.5.0';
runtimeOnly group: 'party.iroiro.luajava', name: 'luajit-platform', version: '3.5.0', classifier: 'natives-desktop';
runtimeOnly group: 'io.grpc', name: 'grpc-netty-shaded', version: '1.60.0';
implementation group: 'io.grpc', name: 'grpc-protobuf', version: '1.60.0';
implementation group: 'io.grpc', name: 'grpc-stub', version: '1.60.0';
compileOnly group: 'org.apache.tomcat', name: 'annotations-api', version: '6.0.53'; // necessary for Java 9+
}
repositories {
mavenCentral();
}
javadoc {
exclude 'dk/gtz/graphedit/proto/**';
exclude 'dk/gtz/graphedit/BuildConfig.java';
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
}
test {
useJUnitPlatform();
}