-
Notifications
You must be signed in to change notification settings - Fork 36
/
build.gradle
122 lines (101 loc) · 3.57 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
plugins {
id 'eclipse'
id 'java-gradle-plugin'
id 'maven-publish' // used for publishing to local maven repository
id 'com.gradle.plugin-publish' version '1.2.1'
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'com.github.ben-manes.versions' version '0.51.0'
}
buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
}
group 'org.javamodularity'
version '1.8.16-SNAPSHOT'
sourceCompatibility = 11
targetCompatibility = 11
repositories {
mavenCentral()
}
configurations {
plugin.description = "Plugin's dependencies"
compile.extendsFrom plugin
}
def jUnitVersion = '5.10.2'
dependencies {
implementation gradleApi()
implementation 'org.jooq:joor:0.9.15'
plugin 'com.github.javaparser:javaparser-symbol-solver-core:3.25.8'
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-pioneer:junit-pioneer:2.2.0'
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$jUnitVersion"
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)
}
}
test {
useJUnitPlatform()
testLogging {
events 'PASSED', 'FAILED', 'SKIPPED', 'STANDARD_OUT'
stackTraceFilters = []
}
}
task createClasspathManifest {
File outputDir = file("$buildDir/$name")
inputs.files sourceSets.main.runtimeClasspath
outputs.dir outputDir
doLast {
outputDir.mkdirs()
file("$outputDir/plugin-classpath.txt").text = sourceSets.main.runtimeClasspath.join('\n')
}
}
// Add the classpath file to the test runtime classpath
dependencies {
testRuntimeOnly files(createClasspathManifest)
}
gradlePlugin {
plugins {
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'
}
}
}
pluginBundle {
website = 'https://github.com/java9-modularity/gradle-modules-plugin'
vcsUrl = 'https://github.com/java9-modularity/gradle-modules-plugin'
tags = ['java', 'modules', 'jpms', 'modularity']
}
publishing { // used for publishing to local maven repository
publications {
pluginMaven(MavenPublication) {
groupId = 'org.javamodularity'
artifactId = 'moduleplugin'
version = project.version
}
}
}