-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
161 lines (124 loc) · 4.07 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
plugins {
id 'com.gradle.plugin-publish' version '0.10.1'
id 'idea'
id 'java-gradle-plugin'
id 'maven-publish'
id 'org.jetbrains.kotlin.jvm' version '1.3.31'
}
group 'com.betomorrow.gradle'
version '1.0.1'
sourceCompatibility = 1.8
targetCompatibility = 1.8
ext {
notSnapshot = { !version.endsWith("SNAPSHOT") }
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
compileOnly gradleApi()
// Third Party
compile 'com.google.api-client:google-api-client:1.27.0'
compile 'com.google.oauth-client:google-oauth-client-jetty:1.27.0'
compile 'com.google.apis:google-api-services-drive:v3-rev136-1.25.0'
compile 'org.apache.poi:poi-ooxml:4.0.1'
// Testing
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1'
testCompile 'org.assertj:assertj-core:3.11.1'
testCompile gradleTestKit()
testCompile 'commons-io:commons-io:2.6'
testRuntime 'cglib:cglib-nodep:3.2.4' // allows mocking of classes (in addition to interfaces)
testRuntime 'org.objenesis:objenesis:2.4' // allows mocking of classes without default constructor (together with CGLIB)
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
test {
useJUnitPlatform()
}
/**
* Integration Tests
*/
sourceSets {
integrationTest {
java.srcDirs = [ file('src/integration-test/java') ]
kotlin.srcDirs = [ file('src/integration-test/kotlin') ]
resources.srcDirs = [ file('src/integration-test/resources') ]
compileClasspath += sourceSets.main.output + configurations.integrationTestCompile
runtimeClasspath += output + sourceSets.main.output + configurations.integrationTestRuntime
}
}
configurations {
integrationTestImplementation.extendsFrom testImplementation
integrationTestCompile.extendsFrom testCompile
integrationTestCompileOnly.extendsFrom testCompileOnly
integrationTestRuntime.extendsFrom testRuntime
integrationTestRuntimeOnly.extendsFrom testRuntimeOnly
integrationTestAnnotationProcessor.extendsFrom testAnnotationProcessor
}
compileIntegrationTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
task integrationTest(type: Test, group: JavaBasePlugin.VERIFICATION_GROUP) {
description = 'Run the integration tests.'
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
outputs.upToDateWhen { false }
mustRunAfter test
useJUnitPlatform()
}
check.dependsOn integrationTest
idea {
module {
testSourceDirs += sourceSets.integrationTest.java.srcDirs
testSourceDirs += sourceSets.integrationTest.kotlin.srcDirs
testResourceDirs += sourceSets.integrationTest.resources.srcDirs
scopes.TEST.plus += [ configurations.integrationTestCompile, configurations.integrationTestRuntime, configurations.integrationTestAnnotationProcessor ]
}
}
/**
* Publishing
*/
task sourceJar(type: Jar) {
from sourceSets.main.allSource
archiveClassifier.set('sources')
}
publishing {
publications {
maven(MavenPublication) {
from components.java
artifact sourceJar
}
}
}
gradlePlugin {
testSourceSets sourceSets.integrationTest
plugins {
wordingPlugin {
id = 'com.betomorrow.dotnet.wording'
displayName = 'Gradle Wording Plugin for .Net Projects'
description = 'Plugin to import wording from Google Sheet then integrate it as .resx files in .Net Projects.'
implementationClass = 'com.betomorrow.gradle.wording.WordingPlugin'
}
}
}
pluginBundle {
website = 'https://github.com/gmarrot/dotnet-wording-plugin'
vcsUrl = 'https://github.com/gmarrot/dotnet-wording-plugin'
tags = [ 'dotnet', 'wording', 'resx', 'tool' ]
}
publishPlugins {
onlyIf notSnapshot
}
/**
* Gradle Wrapper
*/
wrapper {
gradleVersion = '5.5.1'
distributionType = Wrapper.DistributionType.ALL
}