-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle
146 lines (127 loc) · 4.49 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
buildscript {
repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
maven { url 'http://dl.bintray.com/jetbrains/intellij-plugin-service' }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}
plugins {
id "org.jetbrains.intellij" version "0.3.12"
id "de.fuerstenau.buildconfig" version "1.1.8"
}
allprojects {
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'maven'
apply plugin: 'de.fuerstenau.buildconfig'
group = projectGroup
version = projectVersion
sourceCompatibility = javaVersion
targetCompatibility = javaTargetVersion
compileJava.options.encoding = 'UTF-8'
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
//options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
repositories {
mavenLocal()
maven {
url "https://artifacts.metaborg.org/content/groups/public/"
}
}
uploadArchives {
repositories {
mavenDeployer {
mavenLocal()
}
}
}
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
}
configure(allprojects.findAll {it.name != 'spoofax-deps'}) {
apply plugin: 'kotlin'
apply plugin: 'org.jetbrains.intellij'
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlinVersion"
// Added to fix IntelliJ dependency resolution across shadow dependencies
// This list must be the same as those defined in spoofax-deps, minus commons-io.
compileClasspath "org.metaborg:org.metaborg.core:$metaborgVersion"
compileClasspath "org.metaborg:org.metaborg.spoofax.core:$metaborgVersion"
compileClasspath "org.metaborg:org.metaborg.spoofax.meta.core:$metaborgVersion"
// compileClasspath 'commons-io:commons-io:2.4'
}
intellij {
type = "IC"
version intellijVersion
pluginName projectName
downloadSources Boolean.valueOf(intellijSources)
sameSinceUntilBuild Boolean.valueOf(intellijEAP)
alternativeIdePath intellijLocalPath
}
}
configure(allprojects.findAll {it.name != 'spoofax-deps' && it.name != 'org.metaborg.intellij'}) {
// We don't want these tasks in the subprojects.
project.tasks.getByPath("buildPlugin").enabled false
project.tasks.getByPath("patchPluginXml").enabled false
project.tasks.getByPath("prepareSandbox").enabled false
project.tasks.getByPath("prepareTestingSandbox").enabled false
project.tasks.getByPath("runIde").enabled false
project.tasks.getByPath("publishPlugin").enabled false
project.tasks.getByPath("verifyPlugin").enabled false
project.tasks.getByPath("install").enabled false
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn ':spoofax-jps:printAllDependencies'
}
intellij {
version intellijVersion
pluginName projectName
downloadSources Boolean.valueOf(intellijSources)
sameSinceUntilBuild Boolean.valueOf(intellijEAP)
alternativeIdePath intellijLocalPath
// WORKAROUND: For Java 9, instrumentation fails with the error:
// Class not found: javax.swing.JPanel
// https://github.com/JetBrains/gradle-intellij-plugin/issues/235
instrumentCode false
patchPluginXml {
sinceBuild intellijSinceBuild
untilBuild intellijUntilBuild
pluginDescription projectDescription
changeNotes projectChangeNotes
}
publishPlugin {
username publishUsername
password publishPassword
channels publishChannel
}
}
// To debug the JPS plugin: enable the "Debug Build Process" action in the sandbox instance
// (Ctrl+Shift+A), then start a build and attach a remote debugger to port 5005.
// https://github.com/JetBrains/gradle-intellij-plugin/issues/23
afterEvaluate {
tasks.getByName('runIde') {
jvmArgs += ["-Dcompiler.process.debug.port=5005"]
}
}
dependencies {
// Main dependencies
compile project(":spoofax-common")
compile (project(":spoofax-jps")) {
// Fixes an issue where the IntelliJ sources cause class loading to fail.
// ClassNotFoundException: org.jetbrains.jps.intellilang.model.impl.JpsIntelliLangModelSerializerExtension
exclude module: "idea"
}
testCompile "junit:junit:4.13.1"
}