-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
139 lines (113 loc) · 4.16 KB
/
build.gradle
File metadata and controls
139 lines (113 loc) · 4.16 KB
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
plugins {
id 'java'
}
apply from: "$rootDir/gradle/versioning.gradle"
group = 'ch.so.agi'
sourceCompatibility = '11'
targetCompatibility = '11'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}
repositories {
mavenCentral()
maven { url 'https://jars.sogeo.services/mirror' }
}
// TODO
/*
def jeditHome = System.getenv("JEDIT_HOME")
def consoleJar = file("$jeditHome/plugins/Console/jars/console.jar")
dependencies {
compileOnly files(consoleJar)
// … your other compile/runtime deps …
}
*/
/*
configurations.all {
resolutionStrategy {
force 'ch.interlis:ili2c-tool:5.6.6'
force 'ch.interlis:ili2c-core:5.6.5'
}
}
*/
dependencies {
compileOnly files('/Users/stefan/apps/jEdit/5.7.0/jedit.jar')
compileOnly files("${System.properties['user.home']}/Library/jEdit/jars/Console.jar")
compileOnly files("${System.properties['user.home']}/Library/jEdit/jars/ErrorList.jar")
compileOnly files("${System.properties['user.home']}/Library/jEdit/jars/SideKick.jar")
compileOnly files("${System.properties['user.home']}/Library/jEdit/jars/Hyperlinks.jar")
implementation 'ch.interlis:ili2c-core:5.6.6'
implementation 'ch.interlis:ili2c-tool:5.6.6'
implementation 'ch.ehi:ehibasics:1.4.1'
implementation 'ch.interlis:iox-ili:1.24.1'
implementation 'org.json:json:20250517'
implementation("org.opentcs.thirdparty.jhotdraw:jhotdraw:7.6.20190506")
implementation("org.apache.poi:poi-ooxml:5.0.0") {
// make sure the tiny "lite" schemas don't sneak in
exclude group: "org.apache.poi", module: "poi-ooxml-lite"
// Batik isn't needed for XWPF; exclude if some variant tries to pull it
exclude group: "org.apache.xmlgraphics" // (covers xmlgraphics-commons)
exclude group: "org.apache.xmlgraphics", module: "batik-all"
}
// Full schemas (one source of truth for org.openxmlformats.*)
implementation("org.apache.poi:ooxml-schemas:1.4") {
// prevent xmlbeans:3.0.1 from coming in transitively
exclude group: "org.apache.xmlbeans", module: "xmlbeans"
}
implementation("org.apache.xmlbeans:xmlbeans:3.1.0")
}
jar {
archiveFileName = 'InterlisPlugin.jar'
from('InterlisPlugin.props')
from('services.xml')
from('dockables.xml')
from('actions.xml') {
into('/')
}
}
tasks.register("printResolvedDeps") {
doLast {
def ignored = ['jedit.jar'] as Set
def artifacts = configurations.runtimeClasspath
.resolvedConfiguration
.resolvedArtifacts
def jarNames = artifacts.findAll { !ignored.contains(it.file.name) }
.collect { it.file.name }
.sort()
def jarsLine = jarNames.join(' ')
def propsFile = file("InterlisPlugin.props")
if (!propsFile.exists()) {
throw new GradleException("File not found: InterlisPlugin.props")
}
def updatedLines = propsFile.readLines().collect { line ->
if (line.startsWith("plugin.ch.so.agi.jedit.InterlisPlugin.jars=")) {
return "plugin.ch.so.agi.jedit.InterlisPlugin.jars=${jarsLine}"
} else {
return line
}
}
propsFile.text = updatedLines.join(System.lineSeparator())
println "Updated InterlisPlugin.props with jars: $jarsLine"
}
}
tasks.named("classes") {
finalizedBy(printResolvedDeps)
}
// For developing. Works on macOS only at the moment.
tasks.register("copyPluginToJedit", Copy) {
dependsOn 'jar'
def runtimeJars = configurations.runtimeClasspath
.resolvedConfiguration
.resolvedArtifacts
.findAll { it.file.name != 'jedit.jar' }
.collect { it.file }
def pluginJar = file("${buildDir}/libs/InterlisPlugin.jar")
from(runtimeJars + pluginJar) {
// Flatten directory structure
into '.'
}
//into("${System.properties['user.home']}/Library/jEdit/jars")
//into("${System.properties['user.home']}/sources/jEdit/portable-settings/jars")
into("${System.properties['user.home']}/sources/jEdit-5.7.0/build/portable-settings/jars")
}