-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.gradle
More file actions
115 lines (102 loc) · 3.63 KB
/
build.gradle
File metadata and controls
115 lines (102 loc) · 3.63 KB
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
buildscript {
ext.kotlin_version = '1.2.31'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
plugins {
id 'org.jetbrains.intellij' version '0.3.1'
}
group 'me.aristotll'
//version '1.0-SNAPSHOT'
apply plugin: 'groovy'
apply plugin: 'java'
apply plugin: 'kotlin'
sourceCompatibility = 1.8
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
dependencies {
// compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
// compile 'org.codehaus.groovy:groovy-all:2.3.11'
testCompile group: 'junit', name: 'junit', version: '4.12'
compile files('lib/live-plugin-0.5.7 beta.jar')
// form https://github.com/spockframework/spock-example/blob/master/build.gradle
testCompile "org.spockframework:spock-core:1.1-groovy-2.4"
// optional dependencies for using Spock
testCompile "org.hamcrest:hamcrest-core:1.3" // only necessary if Hamcrest matchers are used
testRuntime "net.bytebuddy:byte-buddy:1.6.5" // allows mocking of classes (in addition to interfaces)
testRuntime "org.objenesis:objenesis:2.5.1"
// allows mocking of classes without default constructor (together with CGLIB)
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
intellij {
def env = System.getenv()
def isCi = Boolean.valueOf(env.getOrDefault('IS_CI_MODE', 'false'))
downloadSources = !isCi
println "isCi: $isCi"
if (isCi) {
// (to find available IDE versions see https://www.jetbrains.com/intellij-repository/releases)
// "IU-172.3757.29"
// def version = "181.2784.17"
def theVersionToUse = 'IU-2018.1'
def ideVersion = env.getOrDefault("PLUGIN_IDEA_VERSION", theVersionToUse)
println("Using ide version: ${ideVersion}")
// be aware of possible name collision in closure
version ideVersion
} else {
// local path and version should not be used at same time
localPath = '/Applications/IntelliJ IDEA.app'
}
// name convention https://github.com/JetBrains/gradle-intellij-plugin#setup-dsl
def listOfPlugins = [// https://plugins.jetbrains.com/plugin/1293-ruby/update/44560
'org.jetbrains.plugins.ruby:2018.1.20180327',
]
if (!isCi) {
println 'add idea vim in dev'
// I like ideavim key mapping ...
listOfPlugins.add 'IdeaVIM:0.49'
}
plugins = listOfPlugins
updateSinceUntilBuild = false
instrumentCode = isCi
}
patchPluginXml {
changeNotes """
rubymine bug fix
"""
}
// https://stackoverflow.com/a/33889971/4680436
sourceSets {
main {
java { srcDirs = [] } // no source dirs for the java compiler
groovy { srcDirs = ["src/main/java", "src/main/groovy"] } // compile everything in src/ with groovy
}
test {
java { srcDirs = [] }
groovy { srcDirs = ["src/test/java", "src/test/groovy"] }
}
}
jar {
exclude('rebel.xml', '*.rb')
}
// find the jar in distributions folder instead of libs...
// https://github.com/ocroquette/gradle-extools/blob/master/build.gradle
configurations.all {
resolutionStrategy {
// Workaround for version conflict because of Spock:
// groovy.lang.GroovyRuntimeException: Conflicting module versions. Module [groovy-all is loaded in version 2.4.12 and you are trying to load version 2.4.9
// See https://stackoverflow.com/questions/31099214/tomcat-conflicting-module-versions-module-groovy-all-is-loaded-in-version-2-3/33262366#33262366
force 'org.codehaus.groovy:groovy-all:2.4.12'
}
}