forked from Hannah-Sten/TeXiFy-IDEA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
199 lines (158 loc) · 5.83 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
// Include the Gradle plugins which help building everything.
// Supersedes the use of 'buildscript' block and 'apply plugin:'
plugins {
id 'org.jetbrains.intellij' version '0.4.18'
id 'org.jetbrains.kotlin.jvm' version '1.3.72'
// Plugin which can check for Gradle dependencies, use the help/dependencyUpdates task.
id 'com.github.ben-manes.versions' version '0.28.0'
// Plugin which can update Gradle dependencies, use the help/useLatestVersions task.
id 'se.patrikerdes.use-latest-versions' version '0.2.13'
// Used to debug in a different IDE
id 'maven'
id 'de.undercouch.download' version '4.0.4'
// Test coverage
id 'jacoco'
}
group 'nl.hannahsten'
version '0.7-alpha.70'
repositories {
mavenCentral()
}
sourceSets {
// Specify source directories
main.java.srcDirs += 'src/'
main.java.srcDirs += 'gen/'
main.resources.srcDirs += 'resources/'
main.kotlin.srcDirs += 'src/'
main.kotlin.srcDirs += 'gen/'
// Specify test directories
test.java.srcDirs += 'test/'
test.kotlin.srcDirs += 'test/'
test.resources.srcDirs += 'test/resources/'
}
// Java target version
sourceCompatibility = 1.8
// Specify the right jvm target for Kotlin
compileKotlin {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = ['-Xjvm-default=enable']
}
}
// Same for Kotlin tests
compileTestKotlin {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = ['-Xjvm-default=enable']
}
}
dependencies {
// Local dependencies
compile files("lib/pretty-tools-JDDE-2.1.0.jar")
compile files("lib/JavaDDE.dll")
compile files("lib/JavaDDEx64.dll")
// From Kotlin documentation
compileOnly "org.jetbrains.kotlin:kotlin-stdlib"
// D-Bus Java bindings
compile "com.github.hypfvieh:dbus-java:3.2.0"
compile "org.slf4j:slf4j-simple:2.0.0-alpha1"
// Kotlin coroutines
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.5-2-native-mt-1.4-M1" ) {
exclude(group: "org.jetbrains.kotlin")
}
// Test dependencies
// Also compile junit 4, just in case
testCompile("junit:junit:4.13-rc-2")
testRuntime("org.junit.vintage:junit-vintage-engine:5.6.2")
// Use junit 5 for test cases
testCompile("org.junit.jupiter:junit-jupiter-api:5.6.2")
testRuntime("org.junit.jupiter:junit-jupiter-engine:5.6.2")
// Enable use of the JUnitPlatform Runner within the IDE
testCompile("org.junit.platform:junit-platform-runner:1.6.2")
// just in case
testCompile "org.jetbrains.kotlin:kotlin-test"
testCompile "org.jetbrains.kotlin:kotlin-test-junit"
implementation "org.jetbrains.kotlin:kotlin-script-runtime:1.3.72"
}
// Special resource dependencies
processResources {
from ('lib') {
include 'pretty-tools-JDDE-2.1.0.jar'
include 'JavaDDE.dll'
include 'JavaDDEx64.dll'
}
}
// Copy jar and dependencies in 'lib/' to a zip with the right folder structure
task zip(type: Zip) {
into('TeXiFy-IDEA/lib') {
from jar
from 'lib'
}
}
def pycharmVersion = '2020.1'
// This task is used to debug the plugin in a different IDE, in this case Pycharm
// Source: https://gist.github.com/thomas15v/716ea57261855bf61d8b6131be419c26
//task setupPycharm() {
// if (!new File(".gradle/ide/pycharm-${pycharmVersion}").exists()){
// download {
// src "https://download.jetbrains.com/python/pycharm-professional-${pycharmVersion}.tar.gz"
// dest '.gradle/downloads/py.tar.gz'
// }
// copy {
// from tarTree(resources.gzip('.gradle/downloads/py.tar.gz'))
// into '.gradle/ide'
// }
// }
//}
// In order to debug with PyCharm, just add the -PusePycharm=true argument to your runIde run configuration.
//runIde {
// if (project.hasProperty('usePycharm') && usePycharm == 'true') {
// dependsOn(setupPycharm)
// }
//}
intellij {
if (project.hasProperty('usePycharm') && usePycharm == 'true') {
alternativeIdePath ".gradle/ide/pycharm-${pycharmVersion}"
}
// https://plugins.jetbrains.com/plugin/12175-grazie/versions
plugins = ['tanvd.grazi:201.6668.73', 'java']
// Use the since build number from plugin.xml
updateSinceUntilBuild = false
// Keep an open until build, to avoid automatic downgrades to very old versions of the plugin
sameSinceUntilBuild = true
// Comment out to use the latest EAP snapshot
// Docs: https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
version '2020.1'
}
test {
// Enable JUnit 5 (Gradle 4.6+).
useJUnitPlatform()
// Show test results
testLogging {
events "skipped", "failed"
}
}
// Test coverage reporting
jacocoTestReport {
// Enable xml for codecov
reports {
html.enabled = true
xml.enabled = true
xml.setDestination(file("${buildDir}/reports/jacoco/test/jacocoTestReport.xml" as Object))
}
sourceSets project.sourceSets.main
}
// Allow publishing to the Jetbrains repo via a Gradle task
// This requires to put a Jetbrains Hub token, see http://www.jetbrains.org/intellij/sdk/docs/tutorials/build_system/deployment.html for more details
// Generate a Hub token at https://hub.jetbrains.com/users/me?tab=authentification
// You should provide it either via environment variables (ORG_GRADLE_PROJECT_intellijPublishToken) or Gradle task parameters (-Dorg.gradle.project.intellijPublishToken=mytoken)
publishPlugin {
token intellijPublishToken
// Specify channel as per the tutorial.
// More documentation: https://github.com/JetBrains/gradle-intellij-plugin/blob/master/README.md#publishing-dsl
channels 'alpha'
}