Nezteb
04/25/2019, 3:29 PMjar {
archiveName = "onboarding.jar"
manifest {
attributes(
"Class-Path" to ???
"Main-Class" to "com.mything.MainKt"
)
}
}
but configurations.compile.collect...
isn’t a thing in the Kotlin DSLNezteb
04/25/2019, 3:39 PMapplication
plugin and just using the java
plugin with the jar
task?leonardootto
04/25/2019, 4:08 PMdwursteisen
04/25/2019, 4:21 PMimplementation
nor api
configuration, those would not be available with configurations.compile
Nezteb
04/25/2019, 4:25 PMtasks {
jar {
archiveName = "onboarding.jar"
println("Hello world")
}
}
}
This compiles just fine, but doesn’t print for me, so I assume not.Nezteb
04/25/2019, 6:00 PMtasks {...}
coming before/after dependencies {...}
?Nezteb
04/25/2019, 6:43 PMbuild.gradle
into a separate file dependencies.gradle
. Is it as simple as just copy-pasting the entire dependencies { ... }
block into the new file and it just magically works?Justin Ryan
04/26/2019, 5:51 PMsnowe
04/26/2019, 7:44 PMinit.gradle
script? I'm trying to reference a property using by project
but I get the error message Line 1: val ptSnapshotsReaderPassword: String by project
^ Function invocation 'project(...)' expected
pajatopmr
04/28/2019, 7:03 PMjanvladimirmostert
04/29/2019, 8:36 AMsourceSets {
main {
java {
setSrcDirs(listOf("src/main/java"))
outputDir = File("build/classes")
}
withConvention(KotlinSourceSet::class) {
kotlin.setSrcDirs(listOf("src/main/kotlin"))
kotlin.outputDir = File("build/classes")
}
resources {
setSrcDirs(listOf("src/main/resources"))
outputDir = File("build/classes")
}
}
test {
}
}
The Java one works perfectly, the resources one doesn't do anything and the Kotlin one i'm not sure how to configure.Stephan Schroeder
04/29/2019, 11:16 AMhttps://www.youtube.com/watch?v=mAtrEPeAJSc&t=1710▾
val kotlinVersion = "1.3.21"
plugins {
kotlin("jvm") version kotlinVersion
...
}
dependencies {
...
testImplementation("org.jetbrains.kotlin:kotlin-test-junit:$kotlinVersion")
}
But this fails (“String can’t be called from this context by implicit receiver”) for the usage in plugins.Stephan Schroeder
04/29/2019, 5:15 PMgroup = "uk.co.mulecode"
version = "1.0.0-SNAPSHOT"
...
gradlePlugin {
plugins {
create("easy-scm") {
id = "uk.co.mulecode.easy-scm"
implementationClass = "uk.co.mulecode.EasyScm"
}
}
}
after running gradle install
I can find it in /Users/MDuke/.m2/repository/uk/co/mulecode/easy-scm/1.0.0-SNAPSHOT/easy-scm-1.0.0-SNAPSHOT.jar. Still when trying to use it in another project by importing it locally
buildscript {
repositories {
mavenLocal()
// mavenCentral()
}
dependencies {
// classpath("uk.co.mulecode:easy-scm:1.0.0-SNAPSHOT")
// classpath("uk.co.mulecode:uk.co.mulecode.easy-scm:1.0.0-SNAPSHOT")
classpath(group = "uk.co.mulecode", name="easy-scm", version = "1.0.0-SNAPSHOT")
}
}
plugins {
id("java")
id("maven")
id("uk.co.mulecode.easy-scm") version "1.0.0-SNAPSHOT"
}
...
it isn’t found, as can be seen by running `gradle tasks`:
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/SSchrod/progs/progtests/sandbox-project/build.gradle.kts' line: 12
* What went wrong:
Plugin [id: 'uk.co.mulecode.easy-scm', version: '1.0.0-SNAPSHOT'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'uk.co.mulecode.easy-scm:uk.co.mulecode.easy-scm.gradle.plugin:1.0.0-SNAPSHOT')
Searched in the following repositories:
Gradle Central Plugin Repository
the artifact path looks pretty messed up but I just can’t figure out what the problem is. To add insult to injury importing of the plugin actually works from an equivalent Groovy-DSL gradle project.Nezteb
05/01/2019, 1:33 AMkluck
05/02/2019, 9:01 AMplugins {
id("com.android.application")
id("kotlin-android")
id("kotlin-android-extensions")
}
android {
[...]
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation(project(":domain"))
implementation(project(":presentation"))
[...]
}
I have two other modules: one is domain
which is a basic kotlin module (plugins { kotlin("jvm") }
), and the other one is presentation
, which is an android library:
plugins {
id("com.android.library")
}
android {
[...]
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation(project(":domain"))
[...]
}
In the IDE, everything works fine. But when I'm trying to launch a build, I get weird unresolved reference
issues only on the presentation
module.
Do you know where the problem can come from?wakingrufus
05/03/2019, 2:09 PMlouiscad
05/03/2019, 7:03 PMdarkmoon_uk
05/04/2019, 8:02 AMapply { from(...) }
not available in buildscript
section - obviously I might want to apply some common configuration from a file at the earliest point of evaluation. Are the Gradle authors trying to be awkward?? 😠jdiaz
05/04/2019, 2:59 PMCould not find org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.3.21
? I'm just trying to update to Gradle 5.4 (and have a buildSrc project)ianbrandt
05/06/2019, 4:54 AM> Task :buildSrc:compileKotlin FAILED
e: multi-kotlin-project/buildSrc/src/main/kotlin/kotlin-project.gradle.kts: (2, 22): Unresolved reference: kotlin
e: multi-kotlin-project/buildSrc/src/main/kotlin/kotlin-project.gradle.kts: (9, 2): Unresolved reference: implementation
e: multi-kotlin-project/buildSrc/src/main/kotlin/kotlin-project.gradle.kts: (13, 11): Unresolved reference: KotlinCompile
e: multi-kotlin-project/buildSrc/src/main/kotlin/kotlin-project.gradle.kts: (13, 26): Type mismatch: inferred type is () -> TypeVariable(_L) but Class<TypeVariable(S)> was expected
e: multi-kotlin-project/buildSrc/src/main/kotlin/kotlin-project.gradle.kts: (14, 3): Unresolved reference: kotlinOptions
The intent is to have a multi-project build where standardized Kotlin, Java, etc. plugins and configuration can be mixed into child projects as needed.
Any ideas as to what I'm doing wrong?mkobit
05/07/2019, 1:00 PMbuildSrc
code? im struggling to find anything right nowkevin.cianfarini
05/08/2019, 3:56 PMx80486
05/09/2019, 10:47 PMfrom(compileJava)
is not working. Any advice?Thomas Oddsund
05/13/2019, 8:57 AMBernhard
05/13/2019, 2:28 PMsnowe
05/14/2019, 5:06 PMapply
of the kotlin plugin. I can't parse whether the apply works because they increment the nebula-kotlin version whenever a new kotlin version is released, or if it works because of the configurations
block that changes the resolution strategy. https://github.com/nebula-plugins/nebula-kotlin-plugin/blob/master/src/main/kotlin/netflix/nebula/NebulaKotlinPlugin.ktBenjamin Charais
05/15/2019, 5:24 PMegorand
05/17/2019, 5:41 PM--refresh-dependencies
adalbert
05/17/2019, 8:53 PMmingkangpan
05/19/2019, 11:51 AMallprojects {
repositories {
mavenCentral()
jcenter()
}
}
plugins {
kotlin("jvm") version "1.3.31"
}
mingkangpan
05/19/2019, 11:51 AMallprojects {
repositories {
mavenCentral()
jcenter()
}
}
plugins {
kotlin("jvm") version "1.3.31"
}
robnik
05/19/2019, 1:24 PMbuildscript
section. I have this at top level:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.31")
classpath("org.jetbrains.kotlin:kotlin-serialization:1.3.31")
}
}
mingkangpan
05/19/2019, 8:54 PM