-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
90 lines (77 loc) · 2.21 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
buildscript {
repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
}
repositories {
mavenCentral()
}
subprojects {
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
apply plugin: 'java-library'
version "2.32.0"
sourceCompatibility = 11
targetCompatibility = 11
java {
modularity.inferModulePath = true
}
task sourceJar(type: Jar) {
from sourceSets.main.allJava
}
publishing {
repositories {
maven {
name = "Github"
url = uri("https://maven.pkg.github.com/ealrann/emf-standalone")
credentials {
username = findProperty("github.username")
password = findProperty("github.token")
}
}
}
publications {
gpr(MavenPublication) {
groupId = 'emf.standalone'
artifactId = project.name
from(components.java)
artifact sourceJar {
classifier "sources"
}
}
}
}
eclipse {
jdt {
file {
withProperties { properties ->
// set properties for the file org.eclipse.jdt.core.prefs
properties['org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation'] = 'ignore'
properties['org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation'] = 'ignore'
}
}
}
classpath {
file {
whenMerged {
//Define a module as being either a library or a project dependency.
//Test sources are excluded because eclipse wants them on the classpath for some reason (1)
entries.findAll { isModule(it) }.each {
it.entryAttributes['module'] = 'true'
}
//Test-scoped stuff should set the appropriate flag
entries.findAll { isTest(it) }.each {
it.entryAttributes['test'] = 'true'
}
}
}
}
}
}
boolean isLibrary(entry) { return entry instanceof org.gradle.plugins.ide.eclipse.model.Library }
boolean isProjectDependency(entry) { return entry instanceof org.gradle.plugins.ide.eclipse.model.ProjectDependency }
boolean isTestScope(entry) { return entry.entryAttributes.get('gradle_used_by_scope').equals('test'); }
boolean isSource(entry) { return entry.properties.kind.equals('src'); }
boolean isModule(entry) { (isLibrary(entry) || isProjectDependency(entry)) && !isTestScope(entry); }
boolean isTest(entry) { (isSource(entry) || isLibrary(entry)) && isTestScope(entry); }