diff options
author | 2022-02-04 20:18:20 +0100 | |
---|---|---|
committer | 2022-02-04 20:18:20 +0100 | |
commit | 42db1e8b4dcff3667c5f14e8dd464309c3c2f23e (patch) | |
tree | f5f5efe86fb352980cf144cceb68d1a1101b274f /buildSrc/src/main/groovy/refinery-java-conventions.gradle | |
parent | chore(web): fix Sonar issue (diff) | |
parent | chore(frontend): bump frontend dependencies (diff) | |
download | refinery-42db1e8b4dcff3667c5f14e8dd464309c3c2f23e.tar.gz refinery-42db1e8b4dcff3667c5f14e8dd464309c3c2f23e.tar.zst refinery-42db1e8b4dcff3667c5f14e8dd464309c3c2f23e.zip |
Merge pull request #18 from kris7t/releng-docs
Restructure project
Diffstat (limited to 'buildSrc/src/main/groovy/refinery-java-conventions.gradle')
-rw-r--r-- | buildSrc/src/main/groovy/refinery-java-conventions.gradle | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/buildSrc/src/main/groovy/refinery-java-conventions.gradle b/buildSrc/src/main/groovy/refinery-java-conventions.gradle new file mode 100644 index 00000000..b2efd7e9 --- /dev/null +++ b/buildSrc/src/main/groovy/refinery-java-conventions.gradle | |||
@@ -0,0 +1,79 @@ | |||
1 | plugins { | ||
2 | id 'eclipse' | ||
3 | id 'jacoco' | ||
4 | id 'java' | ||
5 | } | ||
6 | |||
7 | repositories { | ||
8 | mavenCentral() | ||
9 | maven { | ||
10 | url 'https://repo.eclipse.org/content/groups/releases/' | ||
11 | } | ||
12 | } | ||
13 | |||
14 | dependencies { | ||
15 | testImplementation libs.hamcrest | ||
16 | testImplementation libs.junit.api | ||
17 | testRuntimeOnly libs.junit.engine | ||
18 | testImplementation libs.junit.params | ||
19 | testImplementation libs.mockito.core | ||
20 | testImplementation libs.mockito.junit | ||
21 | } | ||
22 | |||
23 | sourceCompatibility = '17' | ||
24 | targetCompatibility = '17' | ||
25 | |||
26 | def jacocoTestReport = tasks.named('jacocoTestReport') | ||
27 | jacocoTestReport.configure { | ||
28 | dependsOn test | ||
29 | reports { | ||
30 | xml.required = true | ||
31 | } | ||
32 | } | ||
33 | |||
34 | tasks.named('test') { | ||
35 | useJUnitPlatform { | ||
36 | excludeTags 'slow' | ||
37 | } | ||
38 | finalizedBy jacocoTestReport | ||
39 | } | ||
40 | |||
41 | tasks.register('slowTest', Test) { | ||
42 | useJUnitPlatform() | ||
43 | finalizedBy jacocoTestReport | ||
44 | } | ||
45 | |||
46 | tasks.named('jar') { | ||
47 | manifest { | ||
48 | attributes( | ||
49 | 'Bundle-SymbolicName': "${project.group}.${project.name}", | ||
50 | 'Bundle-Version': project.version | ||
51 | ) | ||
52 | } | ||
53 | } | ||
54 | |||
55 | def generateEclipseSourceFolders = tasks.register('generateEclipseSourceFolders') | ||
56 | |||
57 | tasks.register('prepareEclipse') { | ||
58 | dependsOn generateEclipseSourceFolders | ||
59 | dependsOn tasks.named('eclipseJdt') | ||
60 | } | ||
61 | |||
62 | tasks.named('eclipseClasspath') { | ||
63 | dependsOn generateEclipseSourceFolders | ||
64 | } | ||
65 | |||
66 | eclipse { | ||
67 | classpath.file.whenMerged { | ||
68 | for (entry in entries) { | ||
69 | if (entry.path.endsWith('-gen')) { | ||
70 | entry.entryAttributes['ignore_optional_problems'] = true | ||
71 | } | ||
72 | } | ||
73 | } | ||
74 | |||
75 | jdt.file.withProperties { properties -> | ||
76 | // Allow @SupperessWarnings to suppress SonarLint warnings | ||
77 | properties['org.eclipse.jdt.core.compiler.problem.unhandledWarningToken'] = 'ignore' | ||
78 | } | ||
79 | } | ||