This repository has been archived by the owner on Apr 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
100 lines (86 loc) · 2.85 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
apply plugin: 'java'
apply plugin: 'maven-publish'
/**
* Change this to your group in reverse domain notation.
*/
group 'de.fearnixx.jeak'
// The current project version - pre-defined for analysis tools that only crawl this file
version '1.0.0'
// Use Mavens snapshot notation convention when we don't want to build a release
if (!project.hasProperty("release") || project.release != 'true') {
version (project.version + '-SNAPSHOT')
}
// We want to explicitly use Java 11 otherwise the Gradle VM language version would be used.
sourceCompatibility = JavaVersion.VERSION_11
project.ext {
// Explicitly set the artifact name so gradle doesn't use its computed value.
artifact = 'someplugin'
}
repositories {
mavenLocal()
maven {
url uri('https://nexus.fearnixx.de/repository/maven-public')
}
}
sourceSets {
main {
java {
srcDirs = ['src/main/java']
}
resources {
srcDirs = ['src/main/resources']
}
}
api {
java {
srcDirs = ['src/api/java']
}
resources {
srcDirs = ['src/api/resources']
}
}
}
dependencies {
apiCompile group: 'de.fearnixx', name: 'jeakbot-api', version: '1.1.0'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
compile group: 'de.fearnixx', name: 'jeakbot-api', version: '1.1.0'
compile group: 'de.mlessmann', name: 'confort-api', version: '1.1.1'
compile sourceSets.api.output
}
/**
* Some things should not be maintained in both the source code and the build scripts.
* Such things are the version numbers of both the plugin and the Jeak version used to compile it.
* That's why we replace tokens in the form of "@VERSION@" with what the build system already knows.
*/
import org.apache.tools.ant.filters.ReplaceTokens
task processSourceReplacements(type: Sync) {
from sourceSets.main.java
def jeakDependencyVersion = project.configurations.getByName('compile')
.resolvedConfiguration
.getFirstLevelModuleDependencies()
.find { it.moduleName == 'jeakbot-api'}
.moduleVersion
inputs.property "version", version
inputs.property "jeakVersion", jeakDependencyVersion
filter(ReplaceTokens, tokens: [
VERSION: version,
JEAK_VERSION: jeakDependencyVersion,
])
into "$buildDir/src"
}
compileJava {
source = processSourceReplacements.outputs
options.compilerArgs << "-Xlint:deprecation"
}
/**
* At the moment, this gradle version is tested.
* It's advisable to keep this in sync with the gradle version the framework uses.
*
* The distribution type is set so that IDEA can provide improved (limited) code assistance.
*/
wrapper {
gradleVersion '6.7.1'
distributionType = Wrapper.DistributionType.ALL
}
apply from: './artifacts.gradle'
apply from: './publication.gradle'