-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
108 lines (87 loc) · 2.98 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
plugins {
id 'java-gradle-plugin'
id 'org.jetbrains.kotlin.jvm'
id 'jvm-test-suite'
// id("maven-publish")
id("com.gradle.plugin-publish") version "1.1.0"
}
apply from: './versions.gradle'
group = "com.x3t.gradle.plugins"
version = plugin_version
java {
sourceCompatibility = jvm_version
}
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}
dependencies {
// Use the Kotlin JUnit 5 integration.
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit5'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testImplementation gradleTestKit()
implementation 'org.openapitools.openapidiff:openapi-diff-core:2.1.0-beta.8'
implementation 'io.swagger.parser.v3:swagger-parser-v3:2.1.16'
testImplementation gradleTestKit()
}
gradlePlugin {
website.set("https://github.com/x3tirl/openapi_diff_gradle_plugin")
vcsUrl.set("https://github.com/x3tirl/openapi_diff_gradle_plugin")
plugins {
openapi_diff {
id = 'com.x3t.gradle.plugins.openapi.openapi_diff'
implementationClass = 'com.x3t.gradle.plugins.openapi.OpenapiDiffPlugin'
displayName = "OpenAPI Diff Gradle Plugin"
description = "OpenAPI Diff Plugin allows the comparison of API Specification files in OpenAPI Spec (v2, v3) format."
tags.set(["openapi", "openapi-3.0", "openapi-2.0", "diff", "kotlin"])
}
}
}
// Add a source set for the functional test suite
sourceSets {
functionalTest {
}
}
/* LOCAL SNAPSHOT DEV */
// to install for local testing - do not load this plugin when publishing to plugin portal
// 'maven-publish' and 'com.gradle.plugin-publish' do not interact well with each other
// https://discuss.gradle.org/t/debug-an-issue-in-publish-plugin-gradle-plugin-not-being-prepended-to-groupid/32720
if (version.contains('SNAPSHOT')) {
apply plugin: 'maven-publish'
publishing {
publications {
pluginMaven(MavenPublication){
}
}
repositories {
maven {
name = 'local'
url = "file://${projectDir}/repo"
}
}
}
}
afterEvaluate {
task removeLocalRepo(type: Delete){
group = 'build'
delete "file://${projectDir}/repo"
}
clean.dependsOn removeLocalRepo
}
configurations.functionalTestImplementation.extendsFrom(configurations.testImplementation)
configurations.functionalTestRuntimeOnly.extendsFrom(configurations.testRuntimeOnly)
// Add a task to run the functional tests
tasks.register('functionalTest', Test) {
testClassesDirs = sourceSets.functionalTest.output.classesDirs
classpath = sourceSets.functionalTest.runtimeClasspath
useJUnitPlatform()
}
gradlePlugin.testSourceSets.add(sourceSets.functionalTest)
tasks.named('check') {
// Run the functional tests as part of `check`
dependsOn(tasks.functionalTest)
}
tasks.named('test') {
// Use JUnit Jupiter for unit tests.
useJUnitPlatform()
}