焦虑的双杠 · Bazel build cache · ...· 3 周前 · |
无聊的大熊猫 · LINK : fatal error ...· 3 周前 · |
稳重的刺猬 · Undefined references ...· 3 周前 · |
不爱学习的柠檬 · GitHub - ...· 2 周前 · |
长情的紫菜汤 · Xcode 14 error Build ...· 1 周前 · |
小胡子的羽毛球 · IPv6支持 - Let's Encrypt· 1 月前 · |
寂寞的茶叶 · zulu@17 — Homebrew ...· 2 月前 · |
傲视众生的盒饭 · 神马书屋_神马书屋.产品中心第506章· 4 月前 · |
重情义的豌豆 · 如何在类型记录中强制执行对象方法的显式返回类 ...· 9 月前 · |
力能扛鼎的饭卡 · 冬季恋歌 易丹dj版广场交谊舞曲MP3下载 ...· 10 月前 · |
build |
https://slack-chats.kotlinlang.org/t/487930/how-do-i-import-a-kotlin-script-from-a-kotlin-build-script-a |
瘦瘦的木耳
5 月前 |
Smallville7123
04/02/2019, 9:52 PMbuild.gradle.kts
) that i want to split into smaller files
gildor
04/03/2019, 6:25 AMSmallville7123
04/03/2019, 6:48 AMgildor
04/03/2019, 7:13 AMgildor
04/03/2019, 7:14 AMgildor
04/03/2019, 7:16 AMSmallville7123
04/03/2019, 8:05 AMSmallville7123
04/03/2019, 8:11 AMorg.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: Build file '/home/macropreprocessor/AndroidStudioProjects/sample/buildSrc/build.gradle.kts' line: 5
Script compilation errors:
Line 5: gradlePlugin {
^ Unresolved reference: gradlePlugin
Line 7: register("greet-plugin") {
^ Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
Line 8: id = "greet"
^ Function invocation 'id(...)' expected
Line 8: id = "greet"
^ No value passed for parameter 'id'
Line 8: id = "greet"
^ Variable expected
Line 8: id = "greet"
^ Type mismatch: inferred type is String but PluginDependencySpec was expected
Line 9: implementationClass = "GreetPlugin"
^ Unresolved reference: implementationClass
7 errors
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:154)
at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:124)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.gradle.internal.exceptions.LocationAwareException: Build file '/home/macropreprocessor/AndroidStudioProjects/sample/buildSrc/build.gradle.kts' line: 5
Script compilation errors:
Line 5: gradlePlugin {
^ Unresolved reference: gradlePlugin
Line 7: register("greet-plugin") {
^ Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
Line 8: id = "greet"
^ Function invocation 'id(...)' expected
Line 8: id = "greet"
^ No value passed for parameter 'id'
Line 8: id = "greet"
^ Variable expected
Line 8: id = "greet"
^ Type mismatch: inferred type is String but PluginDependencySpec was expected
Line 9: implementationClass = "GreetPlugin"
^ Unresolved reference: implementationClass
7 errors
at org.gradle.kotlin.dsl.execution.Interpreter$ProgramHost$compileSecondStageScript$cacheDir$1.invoke(Interpreter.kt:624)
at org.gradle.kotlin.dsl.execution.Interpreter$ProgramHost$compileSecondStageScript$cacheDir$1.invoke(Interpreter.kt:349)
... 166 more
gildor
04/03/2019, 8:12 AMgildor
04/03/2019, 8:13 AMSmallville7123
04/03/2019, 8:13 AMplugins {
`kotlin-dsl`
gradlePlugin {
plugins {
register("greet-plugin") {
id = "greet"
implementationClass = "GreetPlugin"
repositories {
jcenter()
}
gildor
04/03/2019, 8:13 AMgildor
04/03/2019, 8:14 AMjava-gradle-plugin
that provides
gradlePlugin
extension
Smallville7123
04/03/2019, 8:15 AMapply 'java-gradle-plugin'
gildor
04/03/2019, 8:16 AMgildor
04/03/2019, 8:16 AMplugins {
`kotlin-dsl`
`java-gradle-plugin`
}
Smallville7123
04/03/2019, 8:16 AMgildor
04/03/2019, 8:16 AMgildor
04/03/2019, 8:17 AMSmallville7123
04/03/2019, 8:18 AMTimeout waiting to lock buildSrc build lock. It is currently in use by another Gradle instance.
Owner PID: 17080
Our PID: 11178
Owner Operation:
Our operation:
Lock file: /home/macropreprocessor/AndroidStudioProjects/sample/buildSrc/.gradle/noVersion/buildSrc.lock
gildor
04/03/2019, 8:19 AMSmallville7123
04/03/2019, 8:20 AMIn addition to normal Kotlin source files that go under src/main/kotlin
its talking about
buildSrc/src/main/kotlin
right?
gildor
04/03/2019, 8:26 AMSmallville7123
04/03/2019, 8:28 AMplugins {
'greet'
}
gildor
04/03/2019, 8:30 AM'greet'
- doesn’t look correct for me, if you have your plugin in greet.gradle.kts you should use:
plugins {
greet
// or
`greet`
}
Smallville7123
04/03/2019, 8:31 AMstartup failed:
build file '/home/macropreprocessor/AndroidStudioProjects/sample/build.gradle': 31: only buildscript {} and other plugins {} script blocks are allowed before plugins {} blocks, no other statements are allowed
See <https://docs.gradle.org/4.10.1/userguide/plugins.html#sec:plugins_block> for information on the plugins {} block
@ line 31, column 1.
plugins {
1 error
Open File
gildor
04/03/2019, 8:31 AMwhere do i putTo any module where you want to apply it
Smallville7123
04/03/2019, 8:32 AMgildor
04/03/2019, 8:32 AMgildor
04/03/2019, 8:32 AMgildor
04/03/2019, 8:32 AMSmallville7123
04/03/2019, 8:32 AMSmallville7123
04/03/2019, 8:32 AMapply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.sample"
minSdkVersion 'Q'
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), '<http://proguard-rules.pro|proguard-rules.pro>'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
plugins {
'greet'
}
Smallville7123
04/03/2019, 8:33 AMgildor
04/03/2019, 8:33 AM'greet'
- is incorrect
gildor
04/03/2019, 8:34 AMgildor
04/03/2019, 8:34 AMgildor
04/03/2019, 8:35 AMThe plugins {} block must also be a top level statement in the buildscript. It cannot be nested inside another construct (e.g. an if-statement or for-loop).
Smallville7123
04/03/2019, 8:36 AMbuild file '/home/macropreprocessor/AndroidStudioProjects/sample/app/build.gradle': 2: unexpected char: '`' @ line 2, column 5.
`greet`
gildor
04/03/2019, 8:37 AMplugins { greet }
gildor
04/03/2019, 8:37 AMSmallville7123
04/03/2019, 8:38 AMstartup failed:
build file '/home/macropreprocessor/AndroidStudioProjects/sample/app/build.gradle': 1: only id(String) method calls allowed in plugins {} script block
See <https://docs.gradle.org/4.10.1/userguide/plugins.html#sec:plugins_block> for information on the plugins {} block
@ line 1, column 11.
plugins { greet }
gildor
04/03/2019, 8:38 AMgildor
04/03/2019, 8:39 AMSmallville7123
04/03/2019, 8:42 AMgildor
04/03/2019, 8:45 AMSmallville7123
04/03/2019, 8:46 AMgildor
04/03/2019, 8:50 AMgildor
04/03/2019, 8:50 AMgildor
04/03/2019, 8:50 AMgildor
04/03/2019, 8:51 AMplugins { id("greet") }
gildor
04/03/2019, 8:53 AMgildor
04/03/2019, 8:53 AMbuildSrc/src/main
to
buildSrc/src/main/kotlin
Smallville7123
04/03/2019, 8:56 AMgildor
04/03/2019, 8:56 AMgildor
04/03/2019, 8:57 AMgildor
04/03/2019, 8:57 AMSmallville7123
04/03/2019, 8:57 AMgildor
04/03/2019, 8:58 AMSmallville7123
04/03/2019, 8:58 AMSmallville7123
04/03/2019, 8:58 AMgildor
04/03/2019, 8:59 AMgildor
04/03/2019, 8:59 AMgildor
04/03/2019, 9:00 AMso how would i fix this so it worksI wrote you what you should fix a few messages ago: https://kotlinlang.slack.com/archives/C19FD9681/p1554281408066100?thread_ts=1554241933.047600&cid=C19FD9681 https://kotlinlang.slack.com/archives/C19FD9681/p1554281503066700?thread_ts=1554241933.047600&cid=C19FD9681 https://kotlinlang.slack.com/archives/C19FD9681/p1554281620067100?thread_ts=1554241933.047600&cid=C19FD9681
Smallville7123
04/03/2019, 9:01 AMgildor
04/03/2019, 9:02 AMSmallville7123
04/03/2019, 9:03 AMgildor
04/03/2019, 9:03 AMYou use too old GradleI mean this. For your particular sample it’s fine to use Gradle 4.10
Smallville7123
04/03/2019, 9:04 AMSmallville7123
04/03/2019, 9:05 AMrefreshing 'sample' gradle project
gildor
04/03/2019, 9:05 AMSmallville7123
04/03/2019, 9:05 AMgildor
04/03/2019, 9:05 AMSmallville7123
04/03/2019, 9:05 AMgildor
04/03/2019, 9:06 AMrefreshing ‘sample’ gradle projectthis is not a gradle messaage
gildor
04/03/2019, 9:07 AMgildor
04/03/2019, 9:07 AMgildor
04/03/2019, 9:09 AMSmallville7123
04/03/2019, 9:10 AMgildor
04/03/2019, 9:11 AMgildor
04/03/2019, 9:11 AMgildor
04/03/2019, 9:11 AMSmallville7123
04/03/2019, 9:12 AMSmallville7123
04/03/2019, 9:12 AMSmallville7123
04/03/2019, 9:13 AMSmallville7123
04/03/2019, 9:13 AMgildor
04/03/2019, 9:13 AMgildor
04/03/2019, 9:14 AMSmallville7123
04/03/2019, 9:15 AMSmallville7123
04/03/2019, 9:15 AMSmallville7123
04/03/2019, 9:16 AMTASK.dependsOn greet
gildor
04/03/2019, 9:17 AMSmallville7123
04/03/2019, 9:20 AMSmallville7123
04/03/2019, 9:20 AMSmallville7123
04/03/2019, 9:21 AM> Task :app:greet
I'm app.
gildor
04/03/2019, 9:25 AMSmallville7123
04/03/2019, 9:25 AMgildor
04/03/2019, 9:25 AMSmallville7123
04/03/2019, 9:26 AMgildor
04/03/2019, 9:26 AMif i want to publish this would i need to include the buildSrc folderpublish plugin or your project?
Smallville7123
04/03/2019, 9:27 AMgildor
04/03/2019, 9:27 AMas other users may also have a buildSrc folder in their projects which i do not want to overwrite if possibleNot sure what you mean. buildSrc is part of project build configs, you do not publish your build configs, you publish project that builded using your build configs
Smallville7123
04/03/2019, 9:27 AMgildor
04/03/2019, 9:27 AMgildor
04/03/2019, 9:27 AMalso .kts cannot use external dependancies right? or does that only apply to build.gradle.ktsIt can
Smallville7123
04/03/2019, 9:28 AMSmallville7123
04/03/2019, 9:28 AMgildor
04/03/2019, 9:29 AMgildor
04/03/2019, 9:29 AMgildor
04/03/2019, 9:29 AMSmallville7123
04/03/2019, 9:29 AMgildor
04/03/2019, 9:30 AMgildor
04/03/2019, 9:30 AMgildor
04/03/2019, 9:30 AMSmallville7123
04/03/2019, 9:31 AMgildor
04/03/2019, 9:32 AMgildor
04/03/2019, 9:33 AMSmallville7123
04/03/2019, 9:37 AMgildor
04/03/2019, 9:37 AMgildor
04/03/2019, 9:38 AMSmallville7123
04/03/2019, 9:39 AMExecuting tasks: [:app:assembleDebug]
> Task :buildSrc:compileKotlin FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':buildSrc:compileKotlin'.
> Could not resolve all files for configuration ':buildSrc:kotlinCompilerPluginClasspath'.
> Could not find org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.2.61.
Searched in the following locations: file:/home/macropreprocessor/.gradle/caches/4.10.1/embedded-kotlin-repo-1.2.61-2/repo/org/jetbrains/kotlin/kotlin-scripting-compiler-embeddable/1.2.61/kotlin-scripting-compiler-embeddable-1.2.61.jar
Required by:
project :buildSrc
> Could not find org.jetbrains.kotlin:kotlin-sam-with-receiver:1.2.61.
Required by:
project :buildSrc
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at <https://help.gradle.org>
BUILD FAILED in 2s
gildor
04/03/2019, 9:39 AMrepositories{}
block in your buildSrc/build.gradle?
Smallville7123
04/03/2019, 9:42 AMSmallville7123
04/03/2019, 9:42 AMSmallville7123
04/03/2019, 9:45 AMgildor
04/03/2019, 9:45 AMSmallville7123
04/03/2019, 9:48 AMSmallville7123
04/03/2019, 9:49 AMSmallville7123
04/03/2019, 10:00 AMSmallville7123
04/03/2019, 10:00 AMSmallville7123
04/03/2019, 10:00 AMSmallville7123
04/03/2019, 10:00 AMSmallville7123
04/03/2019, 10:01 AMimport org.gradle.api.GradleException
import java.io.*
import java.nio.file.Files.*
import java.util.*
import java.io.File;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.*
Smallville7123
04/03/2019, 10:04 AMSmallville7123
04/03/2019, 10:04 AMgildor
04/03/2019, 10:05 AMproject.rootDir
instead
Smallville7123
04/03/2019, 10:18 AMSmallville7123
04/03/2019, 10:43 AMExecution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
> More than one file was found with OS independent path 'META-INF/better-parse.kotlin_module'
Smallville7123
04/03/2019, 10:46 AMSmallville7123
04/03/2019, 10:30 PMSmallville7123
04/03/2019, 10:32 PMSmallville7123
04/03/2019, 10:34 PMgildor
04/04/2019, 1:31 AMlexer
in a script and task from other module tries to access it, it wrapped by Gradle script environmet
just extract it to own file in buildSrc/src/kotlin and everything will be fine
Smallville7123
04/04/2019, 1:34 AMSmallville7123
04/04/2019, 2:00 AMgildor
04/04/2019, 2:01 AMSmallville7123
04/04/2019, 2:01 AMgildor
04/04/2019, 2:02 AMgildor
04/04/2019, 2:04 AMSmallville7123
04/04/2019, 2:16 AMgildor
04/04/2019, 2:20 AMgildor
04/04/2019, 2:20 AMSmallville7123
04/04/2019, 2:20 AMgildor
04/04/2019, 2:21 AMgildor
04/04/2019, 2:21 AMgildor
04/04/2019, 2:21 AMSmallville7123
04/04/2019, 2:22 AMgildor
04/04/2019, 2:25 AMSmallville7123
04/04/2019, 2:25 AMgildor
04/04/2019, 2:25 AMSmallville7123
04/04/2019, 2:32 AMSmallville7123
04/04/2019, 2:33 AMgildor
04/04/2019, 2:34 AMgildor
04/04/2019, 2:34 AMgildor
04/04/2019, 2:34 AMSmallville7123
04/04/2019, 2:41 AMLine 33: properties.set(mapOf(
^ Type mismatch: inferred type is Map<TypeVariable(K), TypeVariable(V)> but String! was expected
gildor
04/04/2019, 2:41 AMgildor
04/04/2019, 2:42 AMSmallville7123
04/04/2019, 2:42 AMproperties.set(mapOf(
"myProp" to "value",
"prop.with.dots" to "anotherValue"
))
Smallville7123
04/04/2019, 2:42 AMgildor
04/04/2019, 2:43 AMgildor
04/04/2019, 2:43 AMpom
config, which available onluy from Gradle 5.2, as I remember
Smallville7123
04/04/2019, 2:45 AMgildor
04/04/2019, 2:46 AMgildor
04/04/2019, 2:46 AMSmallville7123
04/04/2019, 2:46 AMgildor
04/04/2019, 2:46 AMgildor
04/04/2019, 2:46 AMgildor
04/04/2019, 2:46 AMgildor
04/04/2019, 2:47 AMSmallville7123
04/04/2019, 2:51 AMSmallville7123
04/04/2019, 2:57 AM> Task :buildSrc:compileKotlin UP-TO-DATE
> Task :buildSrc:compileJava NO-SOURCE
> Task :buildSrc:compileGroovy NO-SOURCE
> Task :buildSrc:pluginDescriptors UP-TO-DATE
> Task :buildSrc:processResources UP-TO-DATE
> Task :buildSrc:classes UP-TO-DATE
> Task :buildSrc:inspectClassesForKotlinIC UP-TO-DATE
> Task :buildSrc:jar UP-TO-DATE
> Task :buildSrc:assemble UP-TO-DATE
> Task :buildSrc:compileTestKotlin NO-SOURCE
> Task :buildSrc:pluginUnderTestMetadata UP-TO-DATE
> Task :buildSrc:compileTestJava NO-SOURCE
> Task :buildSrc:compileTestGroovy NO-SOURCE
> Task :buildSrc:processTestResources NO-SOURCE
> Task :buildSrc:testClasses UP-TO-DATE
> Task :buildSrc:test NO-SOURCE
> Task :buildSrc:validateTaskProperties UP-TO-DATE
> Task :buildSrc:check UP-TO-DATE
> Task :buildSrc:build UP-TO-DATE
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'kpp'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:5.3.1.
Searched in the following locations:
- <https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/5.3.1/gradle-5.3.1.pom>
- <https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/5.3.1/gradle-5.3.1.jar>
- <https://jcenter.bintray.com/com/android/tools/build/gradle/5.3.1/gradle-5.3.1.pom>
- <https://jcenter.bintray.com/com/android/tools/build/gradle/5.3.1/gradle-5.3.1.jar>
Required by:
project :
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at <https://help.gradle.org>
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See <https://docs.gradle.org/4.10.1/userguide/command_line_interface.html#sec:command_line_warnings>
CONFIGURE FAILED in 9s
Could not find com.android.tools.build:gradle:5.3.1.
Searched in the following locations:
- <https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/5.3.1/gradle-5.3.1.pom>
- <https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/5.3.1/gradle-5.3.1.jar>
- <https://jcenter.bintray.com/com/android/tools/build/gradle/5.3.1/gradle-5.3.1.pom>
- <https://jcenter.bintray.com/com/android/tools/build/gradle/5.3.1/gradle-5.3.1.jar>
Required by:
project :
Open File
gildor
04/04/2019, 2:58 AMgildor
04/04/2019, 2:59 AMgildor
04/04/2019, 2:59 AMgradle/wrapper/gradle-wrapper.properties
gildor
04/04/2019, 2:59 AMgildor
04/04/2019, 2:59 AMSmallville7123
04/04/2019, 2:59 AMgildor
04/04/2019, 3:00 AMgildor
04/04/2019, 3:00 AMgildor
04/04/2019, 3:00 AMSmallville7123
04/04/2019, 3:01 AMSmallville7123
04/04/2019, 3:02 AMSmallville7123
04/04/2019, 3:07 AMgildor
04/04/2019, 3:43 AMSmallville7123
04/04/2019, 4:10 AMSmallville7123
04/04/2019, 4:10 AMSmallville7123
04/04/2019, 4:11 AMgildor
04/04/2019, 5:11 AMgradle is in my root dirCheck that your IDE uses gradle wrapper, not standalone version
Smallville7123
04/04/2019, 9:43 AM/home/macropreprocessor/AndroidStudioProjects/kpp/buildSrc/build/libs/buildSrc.jar
how would i go about adding it to an existing project and invoking its task
Smallville7123
04/04/2019, 9:45 AMfile
>
new
>
new module
>
import .JAR/AAR
then adding
preBuild.dependsOn KOTLIN_PRE_PROCESSOR
to the end of
app/build.gradle
but i get
Could not get unknown property 'KOTLIN_PRE_PROCESSOR' for project ':app' of type org.gradle.api.Project.
gildor
04/04/2019, 9:45 AMgildor
04/04/2019, 9:46 AMgildor
04/04/2019, 9:46 AMexisting projectAm I understand corretly, existing project which is not a part or submodule of project kpp?
Smallville7123
04/04/2019, 9:47 AMgildor
04/04/2019, 9:47 AMSmallville7123
04/04/2019, 9:47 AMgildor
04/04/2019, 9:49 AMSmallville7123
04/04/2019, 9:52 AMSmallville7123
04/04/2019, 9:59 AMSmallville7123
04/04/2019, 10:05 AMSmallville7123
04/04/2019, 10:05 AMclass kpp : Plugin<Project> {
override fun apply(project: Project): Unit = project.run {
tasks {
register("KOTLIN_PRE_PROCESSOR") {
group = "kotlin pre processor"
description = "kotlin pre processor"
doLast {
globalVariables.INITPROJECTDIR = projectDir
globalVariables.INITROOTDIR = rootDir
println("starting KOTLIN_PRE_PROCESSOR")
find_source_files(globalVariables.INITPROJECTDIR.toString(), "kt")
println("KOTLIN_PRE_PROCESSOR finished")
}
Smallville7123
04/04/2019, 10:06 AMSmallville7123
04/04/2019, 10:09 AMapply from: '../kpp/build.gradle.kts'
preBuild.dependsOn KOTLIN_PRE_PROCESSOR
sadly buildscripts do not support the full capabilities of kotlin, such as external dependancies, local import's, and other bugs that would otherwise be non-present in the official kotlin plugin
efemoney
04/04/2019, 9:01 PMgildor
04/05/2019, 12:20 AMgildor
04/05/2019, 12:21 AMgildor
04/05/2019, 3:18 AMgildor
04/05/2019, 3:20 AMSmallville7123
04/05/2019, 3:26 AMSmallville7123
04/05/2019, 3:30 AMgildor
04/05/2019, 3:30 AMbuildscripts are so much easier to export and import ;-;
gildor
04/05/2019, 3:31 AMSmallville7123
04/05/2019, 3:33 AMgildor
04/05/2019, 3:34 AMSmallville7123
04/05/2019, 3:34 AMgildor
04/05/2019, 3:36 AMSmallville7123
04/05/2019, 3:37 AMFAILURE: Build failed with an exception.
* Where:
Script '/home/macropreprocessor/AndroidStudioProjects/kpp-backup/kpp/buildSrc/build.gradle.kts' line: 1
* What went wrong:
The plugins {} block must not be used here. If you need to apply a plugin imperatively, please use apply<PluginType>() or apply(plugin = "id") instead.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at <https://help.gradle.org>
CONFIGURE FAILED in 0s
The plugins {} block must not be used here. If you need to apply a plugin imperatively, please use apply<PluginType>() or apply(plugin = "id") instead.
Smallville7123
04/05/2019, 3:38 AMapply from: '../kpp/buildSrc/build.gradle.kts'
preBuild.dependsOn KOTLIN_PRE_PROCESSOR
gildor
04/05/2019, 3:39 AMgildor
04/05/2019, 3:39 AMgildor
04/05/2019, 3:39 AMgildor
04/05/2019, 3:39 AMSmallville7123
04/05/2019, 3:39 AMgildor
04/05/2019, 3:39 AMapply plugin: 'kpp'
gildor
04/05/2019, 3:40 AMplugins { id("kpp") }
gildor
04/05/2019, 3:40 AMapply from: ‘../kpp/buildSrc/build.gradle.kts’This is just wrong, you shouldn’t apply build.gradle.kts of another project, including buildSrc
Smallville7123
04/05/2019, 3:41 AMPlugin with id 'kpp' not found.
gildor
04/05/2019, 3:41 AMgildor
04/05/2019, 3:41 AMSmallville7123
04/05/2019, 3:42 AMgildor
04/05/2019, 3:42 AMSmallville7123
04/05/2019, 3:42 AM[macropreprocessor@macro-pc kpp-backup]$ git clone <http://github.com/mgood7123/kpp>
gildor
04/05/2019, 3:44 AMSmallville7123
04/05/2019, 3:44 AMgildor
04/05/2019, 3:45 AMSmallville7123
04/05/2019, 3:45 AM/home/macropreprocessor/AndroidStudioProjects/kpp-backup/kpp/buildSrc
gildor
04/05/2019, 3:45 AMgildor
04/05/2019, 3:46 AMSmallville7123
04/05/2019, 3:46 AMgildor
04/05/2019, 3:46 AMkpp-backup
, not
kpp-backup/kpp
Smallville7123
04/05/2019, 3:46 AMgildor
04/05/2019, 3:46 AMgildor
04/05/2019, 3:47 AMgildor
04/05/2019, 3:47 AMgildor
04/05/2019, 3:47 AMFor multi-project builds there can be only one buildSrc directory, which has to sit in the root project directory
Smallville7123
04/05/2019, 3:48 AMSmallville7123
04/05/2019, 3:48 AMSmallville7123
04/05/2019, 3:49 AMDownload <https://services.gradle.org/distributions/gradle-5.3.1-bin.zip> (83.20 MB)
gildor
04/05/2019, 3:49 AMgildor
04/05/2019, 3:49 AMSmallville7123
04/05/2019, 3:49 AMgildor
04/05/2019, 3:49 AMSmallville7123
04/05/2019, 3:50 AMgildor
04/05/2019, 3:51 AMSmallville7123
04/05/2019, 3:51 AMSmallville7123
04/05/2019, 3:52 AMgildor
04/05/2019, 3:52 AMgildor
04/05/2019, 3:53 AMgildor
04/05/2019, 3:54 AMmaven-publish
maybe used to publish any type of project
Smallville7123
04/05/2019, 3:55 AMgildor
04/05/2019, 3:59 AMSmallville7123
04/05/2019, 4:01 AMgildor
04/05/2019, 4:02 AMSmallville7123
04/05/2019, 4:02 AMSmallville7123
04/05/2019, 4:36 AMplugins {
`kotlin-dsl`
`java-library`
`maven-publish`
signing
group = "com.example"
version = "1.0"
tasks.register<Jar>("sourcesJar") {
from(sourceSets.main.get().allJava)
archiveClassifier.set("sources")
tasks.register<Jar>("javadocJar") {
from(tasks.javadoc)
archiveClassifier.set("javadoc")
publishing {
publications {
create<MavenPublication>("mavenJava") {
artifactId = "my-library"
from(components["java"])
artifact(tasks["sourcesJar"])
artifact(tasks["javadocJar"])
versionMapping {
usage("java-api") {
fromResolutionOf("runtimeClasspath")
usage("java-runtime") {
fromResolutionResult()
pom {
name.set("My Library")
description.set("A concise description of my library")
url.set("<http://www.example.com/library>")
properties.set(mapOf(
"myProp" to "value",
"prop.with.dots" to "anotherValue"
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("<http://www.apache.org/licenses/LICENSE-2.0.txt>")
developers {
developer {
id.set("johnd")
name.set("John Doe")
email.set("<mailto:[email protected]|[email protected]>")
scm {
connection.set("scm:git:<git://example.com/my-library.git%22|git://example.com/my-library.git">)
developerConnection.set("scm:git:<ssh://example.com/my-library.git%22|ssh://example.com/my-library.git">)
url.set("<http://example.com/my-library/>")
repositories {
maven {
// change URLs to point to your repos, e.g. <http://my.org/repo>
val releasesRepoUrl = uri("$buildDir/repos/releases")
val snapshotsRepoUrl = uri("$buildDir/repos/snapshots")
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
signing {
sign(publishing.publications["mavenJava"])
tasks.javadoc {
if (JavaVersion.current().isJava9Compatible) {
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
repositories {
jcenter()
小胡子的羽毛球 · IPv6支持 - Let's Encrypt 1 月前 |
寂寞的茶叶 · zulu@17 — Homebrew Formulae 2 月前 |
傲视众生的盒饭 · 神马书屋_神马书屋.产品中心第506章 4 月前 |