diff options
Diffstat (limited to 'gradle')
-rw-r--r-- | gradle/java-common.gradle | 43 | ||||
-rw-r--r-- | gradle/jmh.gradle | 53 | ||||
-rw-r--r-- | gradle/junit.gradle | 30 | ||||
-rw-r--r-- | gradle/libs.versions.toml | 49 | ||||
-rw-r--r-- | gradle/mwe2.gradle | 11 | ||||
-rw-r--r-- | gradle/wrapper/gradle-wrapper.jar | bin | 55616 -> 59536 bytes | |||
-rw-r--r-- | gradle/wrapper/gradle-wrapper.properties | 2 | ||||
-rw-r--r-- | gradle/xtend.gradle | 33 | ||||
-rw-r--r-- | gradle/xtext-common.gradle | 18 |
9 files changed, 50 insertions, 189 deletions
diff --git a/gradle/java-common.gradle b/gradle/java-common.gradle deleted file mode 100644 index 0a63cfe1..00000000 --- a/gradle/java-common.gradle +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | repositories { | ||
2 | mavenCentral() | ||
3 | maven { | ||
4 | url 'https://repo.eclipse.org/content/groups/releases/' | ||
5 | } | ||
6 | } | ||
7 | |||
8 | sourceCompatibility = '17' | ||
9 | targetCompatibility = '17' | ||
10 | |||
11 | tasks.named('jar') { | ||
12 | manifest { | ||
13 | attributes 'Bundle-SymbolicName': project.name | ||
14 | } | ||
15 | } | ||
16 | |||
17 | apply plugin: 'eclipse' | ||
18 | |||
19 | def generateEclipseSourceFolders = tasks.register('generateEclipseSourceFolders') | ||
20 | |||
21 | tasks.register('prepareEclipse') { | ||
22 | dependsOn generateEclipseSourceFolders | ||
23 | dependsOn tasks.named('eclipseJdt') | ||
24 | } | ||
25 | |||
26 | tasks.named('eclipseClasspath') { | ||
27 | dependsOn generateEclipseSourceFolders | ||
28 | } | ||
29 | |||
30 | eclipse { | ||
31 | classpath.file.whenMerged { | ||
32 | for (entry in entries) { | ||
33 | if (entry.path.endsWith('-gen')) { | ||
34 | entry.entryAttributes['ignore_optional_problems'] = true | ||
35 | } | ||
36 | } | ||
37 | } | ||
38 | |||
39 | jdt.file.withProperties { properties -> | ||
40 | // Allow @SupperessWarnings to suppress SonarLint warnings | ||
41 | properties['org.eclipse.jdt.core.compiler.problem.unhandledWarningToken'] = 'ignore' | ||
42 | } | ||
43 | } | ||
diff --git a/gradle/jmh.gradle b/gradle/jmh.gradle deleted file mode 100644 index 698a57cf..00000000 --- a/gradle/jmh.gradle +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | configurations { | ||
2 | jmh { | ||
3 | extendsFrom implementation | ||
4 | } | ||
5 | } | ||
6 | |||
7 | sourceSets { | ||
8 | jmh { | ||
9 | java.srcDirs = ['src/jmh/java'] | ||
10 | resources.srcDirs = ['src/jmh/resources'] | ||
11 | compileClasspath += sourceSets.main.runtimeClasspath | ||
12 | compileClasspath += sourceSets.test.runtimeClasspath | ||
13 | } | ||
14 | } | ||
15 | |||
16 | dependencies { | ||
17 | jmhImplementation "org.openjdk.jmh:jmh-core:${jmhVersion}" | ||
18 | jmhAnnotationProcessor "org.openjdk.jmh:jmh-generator-annprocess:${jmhVersion}" | ||
19 | } | ||
20 | |||
21 | tasks.register('jmh', JavaExec) { | ||
22 | dependsOn tasks.named('jmhClasses') | ||
23 | main = 'org.openjdk.jmh.Main' | ||
24 | classpath = sourceSets.jmh.compileClasspath + sourceSets.jmh.runtimeClasspath | ||
25 | } | ||
26 | |||
27 | eclipse.classpath { | ||
28 | plusConfigurations += [configurations.jmhCompileClasspath, configurations.jmhRuntimeClasspath] | ||
29 | |||
30 | file.whenMerged { classpath -> | ||
31 | for (entry in classpath.entries) { | ||
32 | // Workaround from https://github.com/gradle/gradle/issues/4802#issuecomment-407902081 | ||
33 | if (entry in org.gradle.plugins.ide.eclipse.model.AbstractClasspathEntry) { | ||
34 | def usedBy = (entry.entryAttributes['gradle_used_by_scope'] ?: '').split(',') | ||
35 | if (usedBy == ['jmh']) { | ||
36 | // Allow test helper classes to be used in benchmarks from Eclipse | ||
37 | // and do not expose JMH dependencies to the main source code. | ||
38 | entry.entryAttributes['test'] = true | ||
39 | } else if ((usedBy.contains('main') || usedBy.contains('test')) && !usedBy.contains('jmh')) { | ||
40 | // main and test sources are also used by jmh sources. | ||
41 | usedBy += 'jmh' | ||
42 | entry.entryAttributes['gradle_used_by_scope'] = usedBy.join(',') | ||
43 | } | ||
44 | } | ||
45 | } | ||
46 | } | ||
47 | } | ||
48 | |||
49 | sonarqube.properties { | ||
50 | properties['sonar.tests'] += [ | ||
51 | 'src/jmh/java', | ||
52 | ] | ||
53 | } | ||
diff --git a/gradle/junit.gradle b/gradle/junit.gradle deleted file mode 100644 index 44a463c7..00000000 --- a/gradle/junit.gradle +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | apply plugin: 'jacoco' | ||
2 | |||
3 | dependencies { | ||
4 | testImplementation "org.junit.jupiter:junit-jupiter-api:${junitVersion}" | ||
5 | testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junitVersion}" | ||
6 | testImplementation "org.junit.jupiter:junit-jupiter-params:${junitVersion}" | ||
7 | testImplementation "org.hamcrest:hamcrest:${hamcrestVersion}" | ||
8 | testImplementation "org.mockito:mockito-core:${mockitoVersion}" | ||
9 | testImplementation "org.mockito:mockito-junit-jupiter:${mockitoVersion}" | ||
10 | } | ||
11 | |||
12 | def jacocoTestReport = tasks.named('jacocoTestReport') | ||
13 | jacocoTestReport.configure { | ||
14 | dependsOn test | ||
15 | reports { | ||
16 | xml.required = true | ||
17 | } | ||
18 | } | ||
19 | |||
20 | tasks.named('test') { | ||
21 | useJUnitPlatform { | ||
22 | excludeTags 'slow' | ||
23 | } | ||
24 | finalizedBy jacocoTestReport | ||
25 | } | ||
26 | |||
27 | tasks.register('slowTest', Test) { | ||
28 | useJUnitPlatform() | ||
29 | finalizedBy jacocoTestReport | ||
30 | } | ||
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 00000000..c0372cad --- /dev/null +++ b/gradle/libs.versions.toml | |||
@@ -0,0 +1,49 @@ | |||
1 | [versions] | ||
2 | jetty = "11.0.7" | ||
3 | jmh = "1.33" | ||
4 | junit = "5.8.2" | ||
5 | mockito = "4.1.0" | ||
6 | mwe2 = "2.12.2.M1" | ||
7 | slf4j = "2.0.0-alpha5" | ||
8 | xtext = "2.26.0.M2" | ||
9 | |||
10 | [libraries] | ||
11 | ecore = { group = "org.eclipse.emf", name = "org.eclipse.emf.ecore", version = "2.25.0" } | ||
12 | ecore-xmi = { group = "org.eclipse.emf", name = "org.eclipse.emf.ecore.xmi", version = "2.16.0" } | ||
13 | ecore-codegen = { group = "org.eclipse.emf", name = "org.eclipse.emf.codegen.ecore", version = "2.28.0" } | ||
14 | gradlePlugin-frontend = { group = "org.siouan", name = "frontend-gradle-plugin-jdk11", version = "6.0.0" } | ||
15 | gradlePlugin-shadow = { group = "gradle.plugin.com.github.johnrengelman", name = "shadow", version = "7.1.0" } | ||
16 | gradlePlugin-sonarqube = { group = "org.sonarsource.scanner.gradle", name = "sonarqube-gradle-plugin", version = "3.3" } | ||
17 | gradlePlugin-xtend = { group = "org.xtext", name = "xtext-gradle-plugin", version = "3.0.0" } | ||
18 | hamcrest = { group = "org.hamcrest", name = "hamcrest", version = "2.2" } | ||
19 | jetty-server = { group = "org.eclipse.jetty", name = "jetty-server", version.ref = "jetty" } | ||
20 | jetty-servlet = { group = "org.eclipse.jetty", name = "jetty-servlet", version.ref = "jetty" } | ||
21 | jetty-websocket-client = { group = "org.eclipse.jetty.websocket", name = "websocket-jetty-client", version.ref = "jetty" } | ||
22 | jetty-websocket-server = { group = "org.eclipse.jetty.websocket", name = "websocket-jetty-server", version.ref = "jetty" } | ||
23 | jmh-core = { group = "org.openjdk.jmh", name = "jmh-core", version.ref = "jmh" } | ||
24 | jmh-annprocess = { group = "org.openjdk.jmh", name = "jmh-generator-annprocess", version.ref = "jmh" } | ||
25 | junit-api = { group = "org.junit.jupiter", name = "junit-jupiter-api", version.ref = "junit" } | ||
26 | junit-engine = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "junit" } | ||
27 | junit-params = { group = "org.junit.jupiter", name = "junit-jupiter-params", version.ref = "junit" } | ||
28 | mockito-core = { group = "org.mockito", name = "mockito-core", version.ref = "mockito" } | ||
29 | mockito-junit = { group = "org.mockito", name = "mockito-junit-jupiter", version.ref = "mockito" } | ||
30 | mwe-utils = { group = "org.eclipse.emf", name = "org.eclipse.emf.mwe.utils", version = "1.6.2.M1" } | ||
31 | mwe2-launch = { group = "org.eclipse.emf", name = "org.eclipse.emf.mwe2.launch", version.ref = "mwe2" } | ||
32 | mwe2-lib = { group = "org.eclipse.emf", name = "org.eclipse.emf.mwe2.lib", version.ref = "mwe2" } | ||
33 | slf4j-api = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j" } | ||
34 | slf4j-simple = { group = "org.slf4j", name = "slf4j-simple", version.ref = "slf4j" } | ||
35 | slf4j-log4j = { group = "org.slf4j", name = "log4j-over-slf4j", version.ref = "slf4j" } | ||
36 | viatra = { group = "org.eclipse.viatra", name = "viatra-query-runtime", version = "2.6.0" } | ||
37 | xtend-lib = { group = "org.eclipse.xtend", name = "org.eclipse.xtend.lib", version.ref = "xtext" } | ||
38 | xtext-bom = { group = "org.eclipse.xtext", name = "xtext-dev-bom", version.ref = "xtext" } | ||
39 | xtext-core = { group = "org.eclipse.xtext", name = "org.eclipse.xtext", version.ref = "xtext" } | ||
40 | xtext-generator-antlr = { group = "org.eclipse.xtext", name = "xtext-antlr-generator", version = "2.1.1" } | ||
41 | xtext-generator = { group = "org.eclipse.xtext", name = "org.eclipse.xtext.xtext.generator", version.ref = "xtext" } | ||
42 | xtext-ide = { group = "org.eclipse.xtext", name = "org.eclipse.xtext.ide", version.ref = "xtext" } | ||
43 | xtext-testing = { group = "org.eclipse.xtext", name = "org.eclipse.xtext.testing", version.ref = "xtext" } | ||
44 | xtext-web = { group = "org.eclipse.xtext", name = "org.eclipse.xtext.web", version.ref = "xtext" } | ||
45 | xtext-xbase = { group = "org.eclipse.xtext", name = "org.eclipse.xtext.xbase", version.ref = "xtext" } | ||
46 | xtext-xbase-ide = { group = "org.eclipse.xtext", name = "org.eclipse.xtext.xbase.ide", version.ref = "xtext" } | ||
47 | |||
48 | [plugins] | ||
49 | versions = { id = "com.github.ben-manes.versions", version = "0.39.0" } | ||
diff --git a/gradle/mwe2.gradle b/gradle/mwe2.gradle deleted file mode 100644 index b4ea8bb8..00000000 --- a/gradle/mwe2.gradle +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | configurations { | ||
2 | mwe2 { | ||
3 | extendsFrom implementation | ||
4 | } | ||
5 | } | ||
6 | |||
7 | dependencies { | ||
8 | mwe2 "org.eclipse.emf:org.eclipse.emf.mwe2.launch:${mwe2Version}" | ||
9 | } | ||
10 | |||
11 | eclipse.classpath.plusConfigurations += [configurations.mwe2] | ||
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 5c2d1cf0..7454180f 100644 --- a/gradle/wrapper/gradle-wrapper.jar +++ b/gradle/wrapper/gradle-wrapper.jar | |||
Binary files differ | |||
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ffed3a25..84d1f85f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties | |||
@@ -1,5 +1,5 @@ | |||
1 | distributionBase=GRADLE_USER_HOME | 1 | distributionBase=GRADLE_USER_HOME |
2 | distributionPath=wrapper/dists | 2 | distributionPath=wrapper/dists |
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip | 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip |
4 | zipStoreBase=GRADLE_USER_HOME | 4 | zipStoreBase=GRADLE_USER_HOME |
5 | zipStorePath=wrapper/dists | 5 | zipStorePath=wrapper/dists |
diff --git a/gradle/xtend.gradle b/gradle/xtend.gradle deleted file mode 100644 index db1c2a57..00000000 --- a/gradle/xtend.gradle +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | apply plugin: 'org.xtext.xtend' | ||
2 | |||
3 | sourceSets { | ||
4 | main { | ||
5 | xtendOutputDir = 'src/main/xtend-gen' | ||
6 | } | ||
7 | test { | ||
8 | xtendOutputDir = 'src/test/xtend-gen' | ||
9 | } | ||
10 | } | ||
11 | |||
12 | xtend.generator { | ||
13 | // As of Xtext 2.26.0.M2, the Xbase compiler doesn't know how to handle Java 12 and up | ||
14 | // and the build fails with a NullPointerException if such Java version is specified. | ||
15 | javaSourceLevel = '11' | ||
16 | } | ||
17 | |||
18 | tasks.named('clean') { | ||
19 | delete 'src/main/xtend-gen' | ||
20 | delete 'src/test/xtend-gen' | ||
21 | } | ||
22 | |||
23 | sonarqube.properties { | ||
24 | properties['sonar.exclusions'] += [ | ||
25 | 'src/main/xtend-gen/**', | ||
26 | 'src/test/xtend-gen/**', | ||
27 | ] | ||
28 | } | ||
29 | |||
30 | tasks.named('generateEclipseSourceFolders') { | ||
31 | dependsOn tasks.named('generateXtext') | ||
32 | dependsOn tasks.named('generateTestXtext') | ||
33 | } | ||
diff --git a/gradle/xtext-common.gradle b/gradle/xtext-common.gradle deleted file mode 100644 index 09980a90..00000000 --- a/gradle/xtext-common.gradle +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | apply from: "${rootDir}/gradle/java-common.gradle" | ||
2 | |||
3 | sourceSets { | ||
4 | main { | ||
5 | java.srcDirs += ['src/main/xtext-gen'] | ||
6 | resources.srcDirs += ['src/main/xtext-gen'] | ||
7 | } | ||
8 | } | ||
9 | |||
10 | tasks.named('clean') { | ||
11 | delete 'src/main/xtext-gen' | ||
12 | } | ||
13 | |||
14 | sonarqube.properties { | ||
15 | properties['sonar.exclusions'] += [ | ||
16 | 'src/main/xtext-gen/**', | ||
17 | ] | ||
18 | } | ||