Skip to content

Commit f67c245

Browse files
committed
make api independent from plugin
1 parent 1684529 commit f67c245

File tree

2 files changed

+35
-52
lines changed

2 files changed

+35
-52
lines changed

build.gradle

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,28 @@ plugins {
66
}
77

88
group 'com.github.hauner.openapi'
9-
version '0.1.0'
9+
version '1.0.0.B1'
1010

1111
targetCompatibility = JavaVersion.VERSION_1_8
1212

1313
repositories {
1414
mavenCentral()
15+
maven {
16+
url "https://dl.bintray.com/hauner/openapi-generatr"
17+
}
18+
}
19+
20+
configurations {
21+
api
22+
implementation.extendsFrom api
1523
}
1624

1725
dependencies {
1826
implementation localGroovy()
1927

28+
// needed at runtime, see copyApi
29+
api 'com.github.hauner.openapi:openapi-generatr-api:1.0.0.B1'
30+
2031
testImplementation ('org.spockframework:spock-core:1.3-groovy-2.5') {
2132
// avoid conflict with localGroovy()
2233
exclude group: 'org.codehaus.groovy'
@@ -31,6 +42,29 @@ testSets {
3142

3243
check.dependsOn testInt
3344

45+
// copy classes of api dependencies to build/classes so they are included in the plugin jar
46+
task copyApi (type: Copy) {
47+
from {
48+
configurations.api.collect { zipTree (it) }
49+
}
50+
into ("$buildDir/classes/groovy/main")
51+
include ('**/*.class')
52+
}
53+
54+
compileJava {
55+
compileJava.dependsOn ('copyApi')
56+
}
57+
58+
//jar {
59+
// dependsOn (configurations.api)
60+
//
61+
// with copySpec {
62+
// from {
63+
// configurations.api.collect { zipTree(it) }
64+
// }
65+
// }
66+
//}
67+
3468
gradlePlugin {
3569
plugins {
3670
generatrPlugin {

src/main/groovy/com/github/hauner/openapi/api/OpenApiGeneratr.groovy

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)