forked from CharlesSkelton/studio
-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.gradle
149 lines (125 loc) · 4.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
import java.text.SimpleDateFormat
apply plugin: 'idea'
//and standard one
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'maven-publish'
apply plugin: 'signing'
compileJava {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
repositories {
mavenCentral()
}
sourceSets {
main {
java {
srcDirs 'src/main'
}
resources {
srcDirs 'src/main','images'
include 'log4j2.xml'
include 'studio*.properties'
include 'org/netbeans/editor/Bundle*.properties'
include '*.png'
include 'notes.html'
include 'build.txt'
include 'images/**'
}
}
test {
java {
srcDirs 'src/test'
}
resources {
srcDirs 'src/test'
include 'syntax.csv'
}
}
intTest {
java.srcDirs += ['src/test-integration']
compileClasspath += sourceSets.main.compileClasspath + sourceSets.test.compileClasspath
runtimeClasspath += sourceSets.main.runtimeClasspath + sourceSets.test.runtimeClasspath
}
}
configurations {
txtmark
intTestImplementation.extendsFrom implementation
intTestRunimeOnly.extendsFrom runtimeOnly
}
test {
useJUnitPlatform()
systemProperty "user.home", System.getProperty("user.home")
}
task integrationTest(type: Test) {
description = 'Runs integration tests.'
group = 'verification'
testClassesDirs = sourceSets.intTest.output.classesDirs
classpath = sourceSets.intTest.runtimeClasspath
systemProperty "user.home", System.getProperty("user.home")
}
compileJava.options.encoding = "UTF-8"
compileTestJava.options.encoding = "UTF-8"
compileIntTestJava.options.encoding = "UTF-8"
dependencies {
txtmark group: 'com.github.rjeschke', name: 'txtmark', version: '0.13'
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.17.1'
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.17.1'
implementation group: 'org.apache.logging.log4j', name: 'log4j-iostreams', version: '2.17.1'
implementation group: 'com.fifesoft', name: 'rsyntaxtextarea', version: '3.2.0'
implementation group: 'org.jfree', name: 'jfreechart', version: '1.5.3'
implementation group: 'org.apache.poi', name: 'poi', version: '5.1.0'
implementation group: 'org.apache.poi', name: 'poi-ooxml', version: '5.1.0'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version:'2.11.2'
implementation group: 'org.drjekyll', name: 'fontchooser', version: '2.4'
implementation group: 'net.java.dev.jna', name: 'jna', version: '5.10.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.3.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1'
intTestImplementation group: 'org.assertj', name: 'assertj-swing-junit', version: '3.9.2'
}
application {
mainClass = 'studio.core.Studio'
}
jar {
manifest {
attributes(
'Class-Path': configurations.runtimeClasspath.files.collect { it.getName() }.join(' '),
'Main-Class': application.mainClass
)
}
}
def buildTime() {
def df = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss")
return df.format(new Date())
}
task getBuildHash {
doLast {
file("src/main/build.txt").text = buildTime()
}
}
task convertNotes (type: JavaExec) {
mainClass = 'com.github.rjeschke.txtmark.Run'
classpath = configurations.txtmark
args 'notes.md'
standardOutput new FileOutputStream(new File(projectDir,"src/main/notes.html"))
}
processResources.dependsOn('getBuildHash', 'convertNotes')
task sourcesJar(type: Jar) {
classifier = 'sources'
duplicatesStrategy = 'warn'
from sourceSets.main.allSource
}
javadoc {
failOnError = false
}
javadoc.options.addStringOption('Xdoclint:none', '-quiet')
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
java {
withJavadocJar()
withSourcesJar()
}