-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathbuild.gradle
More file actions
142 lines (119 loc) · 4.14 KB
/
build.gradle
File metadata and controls
142 lines (119 loc) · 4.14 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
140
141
142
import org.gradle.api.attributes.java.TargetJvmVersion
plugins {
id 'eclipse'
id 'java-gradle-plugin'
id 'maven-publish' // used for publishing to local maven repository
id 'com.gradle.plugin-publish' version '2.1.1'
id 'com.gradleup.shadow' version '9.4.1'
id 'com.github.ben-manes.versions' version '0.54.0'
}
develocity {
buildScan {
termsOfUseUrl = 'https://gradle.com/help/legal-terms-of-use'
termsOfUseAgree = 'yes'
}
}
group 'org.javamodularity'
version '2.0.2-SNAPSHOT'
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
repositories {
mavenCentral()
}
configurations {
plugin.description = "Plugin's dependencies"
compile.extendsFrom plugin
}
def jUnitVersion = '6.0.3'
dependencies {
implementation gradleApi()
implementation 'org.jooq:joor:0.9.15'
plugin 'com.github.javaparser:javaparser-symbol-solver-core:3.28.0'
testImplementation gradleTestKit()
testImplementation 'com.google.guava:guava-base:r03'
testImplementation 'com.google.guava:guava-io:r03'
testImplementation "org.junit.jupiter:junit-jupiter-api:$jUnitVersion"
testImplementation "org.junit.jupiter:junit-jupiter-params:$jUnitVersion"
testImplementation "org.junit.jupiter:junit-jupiter-engine:$jUnitVersion"
testImplementation 'org.junit-pioneer:junit-pioneer:2.3.0'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher' // required when testing in Eclipse
}
shadowJar {
configurations = [project.configurations.plugin]
archiveClassifier = null
dependencies {
include(dependency('com.github.javaparser:javaparser-symbol-solver-core'))
include(dependency('com.github.javaparser:javaparser-symbol-solver-logic'))
include(dependency('com.github.javaparser:javaparser-symbol-solver-model'))
include(dependency('com.github.javaparser:javaparser-core'))
}
relocate 'com.github.javaparser', 'org.javamodularity.moduleplugin.shadow.javaparser'
}
jar.enabled = false
jar.dependsOn shadowJar
processResources.duplicatesStrategy = DuplicatesStrategy.EXCLUDE
configurations {
[apiElements, runtimeElements].each {
it.outgoing.artifacts.removeIf { it.buildDependencies.getDependencies(null).contains(jar) }
it.outgoing.artifact(shadowJar)
}
}
configurations.testCompileClasspath {
attributes {
attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 17)
}
}
configurations.testRuntimeClasspath {
attributes {
attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 17)
}
}
test {
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(17)
}
useJUnitPlatform()
testLogging {
events 'PASSED', 'FAILED', 'SKIPPED', 'STANDARD_OUT'
stackTraceFilters = []
}
}
tasks.register('createClasspathManifest') {
var outputDir = layout.buildDirectory.dir(name)
inputs.files sourceSets.main.runtimeClasspath
outputs.dir outputDir
doLast {
File dir = outputDir.get().asFile
dir.mkdirs()
file("$dir/plugin-classpath.txt").text = sourceSets.main.runtimeClasspath.join('\n')
}
}
// Add the classpath file to the test runtime classpath
dependencies {
testRuntimeOnly files(createClasspathManifest)
}
gradlePlugin {
plugins {
website = 'https://github.com/java9-modularity/gradle-modules-plugin'
vcsUrl = 'https://github.com/java9-modularity/gradle-modules-plugin'
modulesPlugin {
id = 'org.javamodularity.moduleplugin'
displayName = 'Java Modularity Gradle Plugin'
description = 'Plugin that makes it easy to work with the Java Platform Module System'
implementationClass = 'org.javamodularity.moduleplugin.ModuleSystemPlugin'
tags = ['java', 'modules', 'jpms', 'modularity']
}
}
}
publishing { // used for publishing to local maven repository
publications {
create("pluginMaven", MavenPublication) {
groupId = 'org.javamodularity'
artifactId = 'moduleplugin'
version = project.version
}
}
}
defaultTasks("check")