sdeleuze
02/11/2017, 1:19 PMbarteks2x
02/11/2017, 1:37 PMmkobit
02/11/2017, 3:19 PMbarteks2x
02/11/2017, 10:47 PMbarteks2x
02/12/2017, 12:54 PMsetUrl
in maven { }
? Intellij shows it in redikej
02/12/2017, 4:45 PMval myProperty by project
// MyTask has a property named "myProperty"
task<MyTask>("myTask") {
myProperty = // How do I reference myProperty from above
}
I would expect something like this@project.myProperty
.bamboo
02/13/2017, 12:52 PMthis@Build_gradle.myProperty
(assuming your build script file is named build.gradle.kts
)bamboo
02/13/2017, 12:54 PMsetUrl
showing in red has been fixed in master with latest IntelliJ Kotlin pluginikej
02/13/2017, 1:35 PMthis@
, that may be an enhancement on the Kotlin plugin side that would prevent this questionbarteks2x
02/13/2017, 2:23 PMjlleitschuh
02/13/2017, 3:08 PMval specConfig = configurations.create("spec")
val swaggerOutputDir = "${project.buildDir}/swagger-spec"
val swaggerOutputFile = file("$swaggerOutputDir/swagger.yaml")
configure<CodegenConfigurator> {
inputSpec = file("spec/swagger.yaml").absolutePath
outputDir = swaggerOutputDir
lang = "io.swagger.codegen.languages.SwaggerYamlGenerator"
systemProperties.apply {
// Makes it so that only the one yaml file is generated.
put("apis", "")
}
}
val swaggerYamlTask = tasks.getByName(SwaggerCodeGenPlugin.SWAGGER_TASK) as SwaggerCodeGenTask
val yamlArtifact = mapOf(
"name" to "swagger-spec",
"type" to "yaml",
"extension" to "yaml",
"file" to swaggerOutputFile,
"builtBy" to swaggerYamlTask
)
artifacts.add(specConfig.name, yamlArtifact)
jlleitschuh
02/13/2017, 3:09 PMval specFileConfig = configurations.create("specFile")
dependencies {
// Get the spec file from the spec project
add(specFileConfig.name, project(path = ":PlexxiSwagger:Spec", configuration = "spec"))
}
configure<CodegenConfigurator> {
inputSpec = specFileConfig.files.single().absolutePath
}
jlleitschuh
02/13/2017, 3:10 PMspecFileConfig.files.single().absolutePath
jlleitschuh
02/13/2017, 3:10 PMjlleitschuh
02/13/2017, 3:13 PMval swaggerYamlTask = tasks.getByName(SwaggerCodeGenPlugin.SWAGGER_TASK) as SwaggerCodeGenTask
swaggerYamlTask.dependsOn(specFileConfig)
bamboo
02/13/2017, 3:31 PMbarteks2x
02/13/2017, 3:48 PMbuildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.4'
}
}
apply plugin: 'java'
apply plugin: 'com.github.johnrengelman.shadow'
group 'test'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
compile group: 'com.google.code.gson', name: 'gson', version: '2.3.1'
compile group: 'com.google.guava', name: 'guava', version: 'r05'
}
shadowJar {
dependencies {
include(dependency(":gson:"))
}
}
build.dependsOn shadowJar
barteks2x
02/13/2017, 3:49 PMinclude(dependency(":gson:"))
bamboo
02/13/2017, 3:49 PMjlleitschuh
02/13/2017, 3:58 PMsdeleuze
02/13/2017, 3:58 PMmadisp
02/13/2017, 3:59 PMbamboo
02/13/2017, 4:00 PMval shadowJar: ShadowJar by tasks
shadowJar.apply {
dependencies {
include(dependency(":gson:"))
}
}
tasks["build"].dependsOn(shadowJar)
bamboo
02/13/2017, 4:01 PMimport com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
at the top.bamboo
02/13/2017, 4:06 PMtasks {
"shadowJar"(ShadowJar::class) {
dependencies {
include(dependency(":gson:"))
}
}
"build" {
dependsOn("shadowJar")
}
}
bernhard
02/13/2017, 4:09 PMbarteks2x
02/13/2017, 4:49 PMbamboo
02/13/2017, 4:49 PMmaven { setUrl(”…”) }
barteks2x
02/13/2017, 4:50 PMbarteks2x
02/13/2017, 4:50 PM