ribesg
09/27/2018, 10:07 AM* What went wrong:
A problem occurred configuring root project 'myProject'.
> compileSdkVersion is not specified.
Since when is compileSdkVersion
required in the root build script?ribesg
09/27/2018, 12:04 PMSigningConfig with name 'releasekey' not found.
ribesg
09/27/2018, 1:04 PMerror: incompatible types: NonExistentClass cannot be converted to Annotation @error.NonExistentClass()
. The actual annotation in the files is Parcelize
ribesg
09/27/2018, 1:16 PMjmhmccr
09/28/2018, 4:29 AMPlugin [id: 'org.jetbrains.kotlin.jvm', version: '1.3.0-rc-57'] was not found
and don't see a whole bunch of docs for specifying the kotlin plugin version via buildscriptankushg
09/29/2018, 8:27 PMketurn
10/01/2018, 12:26 AMigor.wojda
10/03/2018, 10:41 AM//custom objects in gradle buildSrc (to have dependency autocompletion)
object GradlePluginVersion {
const val detekt = "1.0.0.RC7"
}
object GradlePluginId {
const val detekt = "io.gitlab.arturbosch.detekt"
}
//build.gradle
plugins {
id(GradlePluginId.detekt) version GradlePluginVersion.detekt
}
Want
//build.gradle
plugins {
GradlePluginDependency.detekt
}
The issue I have is that plugin
DSL expect PluginDependenciesSpec
with is an interface, not a concrete class 🤔Lex Luthor
10/04/2018, 1:32 AM"net.researchgate.release"
within a Kotlin DSL Gradle build?
https://github.com/researchgate/gradle-release
This project aims to work much like maven-release-plugin
did with Maven. The problem I'm having is that the DSL relies on Groovy propertyMissing
magic and don't know how to get it to expose the GitConfig
properties of the GitAdapter.. specifically I'd like to be able to set:
-- Groovy
git {
requireBranch = 'master|develop'
}
igor.wojda
10/04/2018, 1:20 PMdetect
, ktlint
, android lint
. These translates to below grade tasks:
./gradlew detektCheck
./gradlew ktlintCheck
./gradlew lint (this task does not exist gradle will select task from app module :app:lint)
As far I I know grade task can’t run another grade task and it can jus depend on another task (with makes perfect sense). Now I was able to write simple task (Kotlin Grade script) that runs detekt
and ktlint
checks (by using dependency mechanizm)
task("staticCheck") {
dependsOn("detekt", "ktlintCheck")
}
Now I am struggling with adding the (Android) lint
. I can’t simply add lint
to dependencies (dependsOn("detekt", "ktlintCheck", "lint")
) because lint
task does not exists in configuration phase:
task("staticCheck") {
val lintDependencies = subprojects.mapNotNull { it.tasks.findByName("lint") } //empty list
doLast {
val lintDependencies = subprojects.mapNotNull { it.tasks.findByName("lint") } //list containing few modules, however I can't use dependsOn here
}
}
What is the best way of running all static analysis checks in single task?igor.wojda
10/05/2018, 4:19 PM//build.gradle
import org.gradle.internal.impldep.com.amazonaws.PredefinedClientConfigurations.defaultConfig
import org.gradle.internal.impldep.org.junit.experimental.categories.Categories.CategoryFilter.include
import org.jlleitschuh.gradle.ktlint.KtlintExtension
plugins {
id("com.android.feature")
id("org.jetbrains.kotlin.android")
}
android {
compileSdkVersion(28)
defaultConfig {
minSdkVersion(28)
targetSdkVersion(28)
buildToolsVersion("28.0.2")
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
proguardFiles("proguard-android.txt", "<http://proguard-rules.pro|proguard-rules.pro>")
}
}
}
dependencies {
implementation(LibraryDependency.kotlin)
//...
}
I want to extract above configuration into separate grade file, so I can easily reuse it in feature modules. I moved the code int one file and added it to build gradle files in feature modules:
//build.gradle.kts mosule1
apply(from = "${rootProject.file("common_feature.gradle.kts")}")
//build.gradle.kts mosule2
apply(from = "${rootProject.file("common_feature.gradle.kts")}")
//common_feature.gradle.kts
//Basicly all the above configuration that was initially in above build.gradle file and few delegates for configurations
import org.gradle.internal.impldep.com.amazonaws.PredefinedClientConfigurations.defaultConfig
import org.gradle.internal.impldep.org.junit.experimental.categories.Categories.CategoryFilter.include
val implementation by configurations
val testImplementation by configurations
val androidTestImplementation by configurations
plugins {
id(GradlePluginId.androidFeature)
id(GradlePluginId.kotlinAndroid)
}
android {
compileSdkVersion(28)
defaultConfig {
minSdkVersion(28)
targetSdkVersion(28)
buildToolsVersion("28.0.2")
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
proguardFiles("proguard-android.txt", "<http://proguard-rules.pro|proguard-rules.pro>")
}
getByName("debug") {
isMinifyEnabled = false
}
}
}
dependencies {
implementation(LibraryDependency.kotlin)
}
The problem with extracting the code into separate gradle file is that KTS compiler throws Unresolved reference: android
error. Does someone know how to fix it?Hamza
10/06/2018, 6:06 AMNikky
10/06/2018, 7:34 AMPaul Woitaschek
10/07/2018, 6:55 AMLommelun
10/09/2018, 12:30 AMHamza
10/09/2018, 3:30 AMdwursteisen
10/09/2018, 8:49 AMsubproject
block with a dependencies
block inside. We’re trying to call the method compile
in it but IntelliJ don’t find it. We missing something but we don’t see what. Have you got any idea about this?
subprojects {
dependencies {
compile("our dependency")
}
}
I presume that something is missing in our scope so compile
extension method is not available.mgrzechocinski
10/09/2018, 2:41 PMapply from:
directive.
Simplifying, when my build.gradle.kts
file looks like this:
plugins {
id("kotlin-android-extensions")
}
androidExtensions {
isExperimental = true
}
it’s works fine. However, when I try to extract plugin definition to a separated file and apply it from my `build.gradle.kts`:
apply{
from("$rootDir/kotlin_shared.gradle.kts") //contains plugins { id("kotlin-android-extensions") }
}
androidExtensions {
isExperimental = true
}
it fails on "Unresolved reference: androidExtensions"
. In Groovy version I had apply from:
directive on top of my build.gradle
file and it worked pretty well. Seems like kotlin’s apply { from () }
doesn’t work like Gradle’s apply from:
version, or am I missing sth?keturn
10/09/2018, 7:27 PMtapchicoma
10/09/2018, 7:31 PMtapchicoma
10/09/2018, 7:40 PMzachtib
10/09/2018, 11:20 PMPlugin [id: 'org.jetbrains.kotlin.jvm', version: '1.3.0-rc-131'] was not found in any of the following sources:
Nikky
10/10/2018, 1:16 PMjmfayard
10/11/2018, 9:00 AMGradle scope
with the pattern file:*.gradle||file:*.kts||file[buildSrc]:*/||file:.gitlab-ci.yml||file:*.properties
, it's immensly useful when you are messing with your gradle builds.
https://youtrack.jetbrains.com/issue/IDEA-200335ribesg
10/11/2018, 10:47 AMorg.gradle.api.plugins.UnknownPluginException: Plugin [id: 'org.gradle.kotlin.kotlin-dsl', version: '1.0-rc-12']
dwursteisen
10/11/2018, 2:09 PM* What went wrong:
org.jetbrains.kotlin.gradle.plugin.KotlinPluginWrapperKt.getKotlinPluginVersion(Lorg/gradle/api/Project;)Ljava/lang/String;
This method exist in new kotlin plugin version (1.2.61) but our build depends on the version (1.2.51) where the version doesn’t exist. The thing is: we don’t understand why it depends of the version 1.2.51 because we explicitly ask to use the 1.2.61 version. (maybe we made a mistake somewere, but we never use 1.2.51 anywhere in our build...)
When running ./gradlew build --debug
, we get this:
15:38:05.214 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Resolve kotlin-scripting-gradle.jar (org.jetbrains.kotlin:kotlin-scripting-gradle:1.2.51)' completed
There is no new version of kotlin-scripting-gradle
. Could you give us a tip to find what trying to use this dependency?michaelsims
10/11/2018, 7:17 PMbuildSrc
and kotlin-dsl. Right now I'm stuck using Gradle 4.4 and Android Studio 3.1.4 and I noticed that I cannot navigate to sources for things in kotlin-stdlib (it takes me to decompiled .class files instead) and documentation is also not available. Is there a workaround for this apart from upgrading to a newer version of Gradle?ikej
10/11/2018, 8:57 PMdwursteisen
10/12/2018, 9:20 AMwrapper
task or something in your build.gradle.kts? Are you using gradlew
or gradle
? (checks, just in case...)jmfayard
10/12/2018, 12:27 PMjmfayard
10/12/2018, 12:27 PMegorand
10/13/2018, 3:50 AMjmfayard
10/13/2018, 5:58 AM