Shan
01/26/2020, 2:16 AMrepositories {
maven(url = "<https://maven.jetbrains.space/[my-org]/[my-repo]>")
}
Ran Magen
01/26/2020, 5:26 AMexpand
function, we passed in a map where a key contained a function value:
[ pick: { Map<String, Object> stackMap, Object fallback -> stackMap.getOrDefault(stack, fallback) } ]
The template file we copied had stuff like:
replicas: ${pick(1, 'staging': 2, 'prod': 9)}
Now that I've converted the groovy code (in the build file, not the template) to Kotlin script and it now looks like
val pick = { stackMap: Map<String, Any>, fallback: Any -> stackMap.getOrDefault(stack, fallback) }
and I pass in to `expand`:
expand(mapOf("pick" to pick))
expansion fails saying this:
groovy.lang.MissingMethodException: No signature of method: Build_gradle$pick$1.call() is applicable for argument types: (LinkedHashMap, Integer) values: [[staging:2, prod:9], 1]
If possible, what's the right way to pass a function in expand
properties?thanksforallthefish
01/27/2020, 5:23 PMplugins {
id("org.hidetake.swagger.generator") version "2.18.1"
}
tasks {
withType<org.hidetake.gradle.swagger.generator.GenerateSwaggerUI> {
dependsOn("openapi3")
inputFile = file("$buildDir/api-spec/openapi3.json")
}
}
org.hidetake.gradle.swagger.generator.GenerateSwaggerUI
is red, causing then dependsOn
and inputFile
to be not recognizedRay Eldath
01/28/2020, 12:54 PM$
when dealing with string? currently I have to write something like "${'$'}argon2i${'$'}v=19${'$'}m=65536,t=10,p=1${'$'}JAqVeeNXYjPzqQxYOuek9w${'$'}bV2xPVMnPsV36LesGvM/yUDaisR3Bugn9wneiCPMnBY"
which is absolutely very ugly 🙃tylerwilson
01/28/2020, 10:14 PMBrendan Weinstein
01/29/2020, 12:55 AMbuildSrc
(eg use a plugin for the development of plugins), but I am getting this error:
Plugin [id: 'kotlinx-serialization'] was not found in any of the following sources:
Anyone know how to make a non-core plugin available within the buildSrc build.gradle.kts?napperley
01/29/2020, 2:03 AMMoritz Platt
01/29/2020, 11:09 AMorg.jetbrains.kotlin:kotlin-gradle-plugin
in a Gradle multi-project build?Sam Garfinkel
01/29/2020, 4:31 PMCalling non-final function 'function' in constructor
warning when configuring subclasses of Gradle tasks? For example:
open class ChildJavaExec: JavaExec() {
init {
workingDir("foo/bar")
}
}
Not sure if I should just ignore it? Tasks need to be non-final in order for Gradle to inject and construct them.Sagar Suri
01/30/2020, 4:41 AMgradle
build system w.r.t android?Artem Shumidub
01/30/2020, 6:24 AMHarun
01/31/2020, 6:38 AMJamie Taylor
01/31/2020, 11:01 AMkotlin.caching.enabled=true
org.gradle.caching=true
android.databinding.incremental=true
2. The Kotlin compiler is just really slow. The project is about 90% Java and 10% Kotlin, but on a clean build the Kotlin compile task takes about twice as long as the java compile task. The project also has a very small pure kotlin module containing three small files, and I just noticed on the scan that the kotlin compile task for that project is taking even longer than the kotlin compile for the main app.
I can't find any particularly helpful resources regarding kotlin compiler performance. If I could just see which files it was spending a lot of time on that might help.Kris Wong
01/31/2020, 3:05 PMandroid.defaultConfig.testInstrumentationRunnerArguments.remove 'notClass'
android.defaultConfig.testInstrumentationRunnerArguments 'class': 'com.boxer.sendHarness.SendMessageHarness'
Alex Woods
01/31/2020, 3:20 PMDariusz Kuc
02/01/2020, 1:41 AMjmfayard
02/03/2020, 6:24 AMtseisel
02/03/2020, 10:47 AMgradle.properties
:
com.foo.myproperty=bar
What is the idiomatic way to read that property from scripts ?
The property delegate syntax val myProperty by project
makes it mandatory to declare a variable with the same name as the property.
Moreover, it seems that there is no settings.property("com.foo.myproperty")
function.Chenn
02/04/2020, 8:08 AMtarek
02/05/2020, 10:06 PMkts
?
allprojects {
if (plugins.hasPlugin("org.jetbrains.kotlin.jvm")) {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
plugins.withId("com.android.library") {
extensions.getByName("android").compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
}
Marcelo Adamatti
02/06/2020, 6:44 PMDariusz Kuc
02/07/2020, 2:57 AM@Input
@Option(option = "outputFileName", description = "target file name")
val outputFileName: Property<String> = project.objects.property(String::class.java)
@Suppress("UnstableApiUsage")
@Internal
@OutputFile
val outputFile: RegularFileProperty = project.objects.fileProperty()
How do I properly initialize the outputFile
with the specified outputFileName
?Javier
02/10/2020, 1:19 AMsean
02/10/2020, 2:01 AMNikita Khlebushkin
02/10/2020, 3:03 PMhttps://youtu.be/w-GMlaziIyo?t=118▾
compile.dependsOn(something)
, but I don't know what task should I put in the parenthesis (I don't create explicitly any tasks)jk2018
02/10/2020, 11:02 PMapahl
02/11/2020, 2:38 PM.gradle.kts
build files) tutorials available that do not require such a Java / JVM background? I am exploring Kotlin mainly for Data Science purposes.corneil
02/11/2020, 3:04 PMTmpod
02/12/2020, 7:33 PMgroup = "..."
version = "..."
description = "..."
object DependencyVersions {
... // just a bunch of const strings for versions
}
plugins {
kotlin("jvm") version "1.3.70-eap-184" // afaik this block doesn't see DependencyVersions, so versions gotta be put manually here ig...
application
}
repositories {
... // bunch of repos
maven("<https://dl.bintray.com/kotlin/kotlin-eap>")
}
dependencies {
implementation(kotlin("stdlib"))
... // more deps
}
tasks {
compileKotlin {
... // I add some compiler args here
}
}
application {
mainClassName = "..."
}
with this said, Gradle can't find any kotlin version that satisfies what I've specifiedSylvain Patenaude
02/12/2020, 10:12 PMSylvain Patenaude
02/12/2020, 10:12 PMmbonnin
02/12/2020, 10:13 PMmaven-publish
gradle pluginoctylFractal
02/12/2020, 10:13 PMmaven-publish
is the general standardnexus-publish
to ensure it works properly: https://github.com/marcphilipp/nexus-publish-pluginmbonnin
02/12/2020, 10:15 PMmaven-publish
doesn't do AFAIK)Fleshgrinder
02/12/2020, 10:45 PMwithSourcesJar()
and withJavadocJar()
isn't much work.gildor
02/12/2020, 11:30 PMDariusz Kuc
02/13/2020, 12:40 AMmaven-publish
to publish artifacts to the Maven Central
• signing
plugin to sign the artifacts
• de.marcphilipp.nexus-publish
for creating single staging repository in nexus
• io.codearte.nexus-staging
to ensure single staging repository is used for for all artifacts and automatically releasing it at the end
Note that maven-publish
will publish to nexus (each artifact ended up in its own staging repo) but it won't automatically release artifacts so in order to avoid manual step I added those 2 extra plugins.