-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add kroto configuration gradle dsl * split up dsl config example into separate file
- Loading branch information
1 parent
dd0a70d
commit a7198fc
Showing
16 changed files
with
665 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
|
||
apply plugin: "com.github.marcoferrer.kroto-plus" | ||
|
||
krotoPlus { | ||
config { | ||
//noinspection GroovyAssignabilityCheck | ||
main { | ||
mockServices { | ||
filter { | ||
addIncludePath("jojo/*") | ||
} | ||
implementAsObject = true | ||
generateServiceList = true | ||
serviceListPackage = "jojo.bizarre.adventure" | ||
serviceListName = "MockJojoServices" | ||
} | ||
|
||
mockServices { | ||
filter { | ||
addIncludePath("test/message/*") | ||
} | ||
implementAsObject = true | ||
generateServiceList = true | ||
serviceListPackage = "test.message" | ||
} | ||
|
||
protoBuilders { | ||
filter { | ||
addExcludePath("google/*") | ||
} | ||
unwrapBuilders = true | ||
useDslMarkers = true | ||
} | ||
|
||
grpcStubExts { | ||
supportCoroutines = true | ||
} | ||
grpcCoroutines() | ||
extendableMessages { | ||
filter { | ||
addIncludePath("jojo/bizarre/adventure/stand/*") | ||
} | ||
} | ||
generatorScripts { | ||
addScriptPath("helloThere.kts") | ||
scriptBundle = file("kp-scripts/build/libs/kp-scripts.jar") | ||
} | ||
generatorScripts { | ||
addScriptPath("varArgExtensionGenerator.kts") | ||
scriptBundle = file("kp-scripts/build/libs/kp-scripts.jar") | ||
} | ||
insertions { | ||
filter { | ||
addIncludePath("jojo/bizarre/adventure/character/*") | ||
} | ||
entry { | ||
point = 'MESSAGE_IMPLEMENTS' | ||
addScriptPath "extendableMessages.kts" | ||
scriptBundle = file("kp-scripts/build/libs/kp-scripts.jar") | ||
} | ||
entry { | ||
point = 'BUILDER_IMPLEMENTS' | ||
addScriptPath "extendableMessages.kts" | ||
scriptBundle = file("kp-scripts/build/libs/kp-scripts.jar") | ||
} | ||
entry { | ||
point = 'CLASS_SCOPE' | ||
addScriptPath "extendableMessages.kts" | ||
scriptBundle = file("kp-scripts/build/libs/kp-scripts.jar") | ||
} | ||
entry { | ||
point = 'OUTER_CLASS_SCOPE' | ||
addScriptPath(file("kp-scripts/src/main/kotlin/sampleInsertionScript.kts").toString()) | ||
} | ||
} | ||
} | ||
} | ||
|
||
} | ||
|
||
protobuf { | ||
protoc { artifact = "com.google.protobuf:protoc:${versions.protobuf}" } | ||
|
||
generatedFilesBaseDir = "$buildDir/generated-sources" | ||
|
||
//noinspection GroovyAssignabilityCheck | ||
plugins { | ||
grpc { artifact = "io.grpc:protoc-gen-grpc-java:${versions.grpc}" } | ||
kroto { | ||
artifact = "com.github.marcoferrer.krotoplus:protoc-gen-kroto-plus:${versions.krotoplus}" | ||
} | ||
} | ||
|
||
generateProtoTasks { | ||
all().each { task -> | ||
// If we're using precompiled scripts for improved performance then we | ||
// should depend on the jar task for our scripts | ||
task.dependsOn ':kp-scripts:jar' | ||
|
||
task.plugins { | ||
grpc { outputSubDir = "java" } | ||
kroto { | ||
// The extendable-messages generator needs the outputSubDir | ||
// to be the same as 'task.builtins.java.outputSubDir' since | ||
// it relies on the insertion_point api from protoc. | ||
outputSubDir = "java" | ||
option krotoPlus.config.main.asOption() | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright 2019 Kroto+ Contributors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
dependencies{ | ||
implementation project(":protoc-gen-kroto-plus") | ||
implementation "com.google.protobuf:protobuf-java:3.6.1" | ||
implementation "org.jetbrains.kotlin:kotlin-script-util" | ||
implementation ("com.squareup:kotlinpoet:0.7.0") { | ||
exclude group: 'org.jetbrains.kotlin' | ||
} | ||
} | ||
|
||
jar { | ||
archiveName = 'bundle.jar' | ||
} |
Oops, something went wrong.