Comments (8)
When importing a project in intellij when I apply the build scan plugin from an init script like this:
initscript {
repositories {
maven {
url "https://plugins.gradle.org/m2"
}
}
dependencies {
classpath "com.gradle:build-scan-plugin:1.8"
}
}
rootProject { prj ->
apply plugin: initscript.classLoader.loadClass("com.gradle.scan.plugin.BuildScanPlugin")
buildScan {
publishAlways()
}
}
I get the following error in IDEA:
Error:Failed to compile accessors
projectSchema: ProjectSchema(extensions={ext=org.gradle.api.plugins.ExtraPropertiesExtension, buildScan=com.gradle.scan.plugin.internal.api.f}, conventions={}, configurations=[])
classPath: [/Users/wolfs/.gradle/caches/4.1-20170707032407+0000/generated-gradle-jars/gradle-api-4.1-20170707032407+0000.jar, /Users/wolfs/.gradle/wrapper/dists/gradle-kotlin-dsl-4.1-20170707032407+0000-all/d3mj6o6gozo0alzok0r3j1q50/gradle-4.1-20170707032407+0000/lib/groovy-all-2.4.11.jar, /Users/wolfs/.gradle/wrapper/dists/gradle-kotlin-dsl-4.1-20170707032407+0000-all/d3mj6o6gozo0alzok0r3j1q50/gradle-4.1-20170707032407+0000/lib/gradle-installation-beacon-4.1.jar, /Users/wolfs/.gradle/caches/4.1-20170707032407+0000/generated-gradle-jars/gradle-kotlin-dsl-extensions-0.10.0-SNAPSHOT-4.1-20170707032407+0000.jar, /Users/wolfs/.gradle/wrapper/dists/gradle-kotlin-dsl-4.1-20170707032407+0000-all/d3mj6o6gozo0alzok0r3j1q50/gradle-4.1-20170707032407+0000/lib/gradle-kotlin-dsl-0.10.0-SNAPSHOT.jar, /Users/wolfs/.gradle/wrapper/dists/gradle-kotlin-dsl-4.1-20170707032407+0000-all/d3mj6o6gozo0alzok0r3j1q50/gradle-4.1-20170707032407+0000/lib/gradle-kotlin-dsl-compiler-plugin-0.10.0-SNAPSHOT.jar, /Users/wolfs/.gradle/wrapper/dists/gradle-kotlin-dsl-4.1-20170707032407+0000-all/d3mj6o6gozo0alzok0r3j1q50/gradle-4.1-20170707032407+0000/lib/gradle-kotlin-dsl-tooling-models-0.10.0-SNAPSHOT.jar, /Users/wolfs/.gradle/wrapper/dists/gradle-kotlin-dsl-4.1-20170707032407+0000-all/d3mj6o6gozo0alzok0r3j1q50/gradle-4.1-20170707032407+0000/lib/kotlin-reflect-1.1.3-2.jar, /Users/wolfs/.gradle/wrapper/dists/gradle-kotlin-dsl-4.1-20170707032407+0000-all/d3mj6o6gozo0alzok0r3j1q50/gradle-4.1-20170707032407+0000/lib/kotlin-stdlib-1.1.3-2.jar]
I would expect this to work or at least give me a better error message what I should do.
from gradle.
Blocked by gradle/kotlin-dsl-samples#416.
from gradle.
Just to explain the behaviour reported here, the latest release provides extension accessors by default. This requires the types of all extensions to be visible in the build script classpath but currently initscript
dependencies are not thus the type of the buildScan
extension is not visible and compilation fails.
This behaviour can be disabled via a Gradle project property:
org.gradle.kotlin.dsl.accessors=off
from gradle.
I'm using the following init.d
script to enable build scans in all my builds:
initscript {
repositories {
maven {
url "https://plugins.gradle.org/m2"
}
}
dependencies {
classpath "com.gradle:build-scan-plugin:1.8"
}
}
rootProject {
apply plugin: com.gradle.scan.plugin.BuildScanPlugin
buildScan {
publishAlways()
if (project.hasProperty("useProdScanServer")) {
licenseAgreementUrl = "https://gradle.com/terms-of-service"
licenseAgree = "yes"
} else {
server = "https://internal.gradle.enterprise.server"
}
}
}
Importing official Kotlin DSL samples to IDEA results in the following error:
Error:The build scan plugin must be applied early in the build lifecycle.
Fixing this problem requires changing how you are applying the build scan plugin to your build.
Please see https://gradle.com/scans/help/plugin-late-apply for how to resolve this problem.
from gradle.
@pioterj, I get the same error with a Groovy based build script so there's something else going on here.
from gradle.
The following project reproduces the issue with a Groovy build script on the latest 4.1 nightly:
from gradle.
This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. If you're interested in how we try to keep the backlog in a healthy state, please read our blog post on how we refine our backlog. If you feel this is something you could contribute, please have a look at our Contributor Guide. Thank you for your contribution.
from gradle.
This issue has been automatically closed due to inactivity. If you can reproduce this on a recent version of Gradle or if you have a good use case for this feature, please feel free to reopen the issue with steps to reproduce, a quick explanation of your use case or a high-quality pull request.
from gradle.
Related Issues (20)
- Cannot run daemons in WSL while there is an active one on Windows side
- Improve dependency resolution for localGroovy() HOT 1
- add automatic detection for modules containing `build.gradle.kts`
- Improve HTML test results reports HOT 1
- Please make ANTLR plugin support kotlin HOT 1
- Report reason for Configuration Cache misses via an API
- javaToolchains incorrectly reports 'does not contain a java executable' on Debian and Ubuntu HOT 2
- Add lifecycle event provider for the start of execution phase to `FlowProviders`
- Could not resolve all artifacts for configuration 'incomingCatalogForLibs0'.
- Re-add task path information to problem reports
- Adjust aggregation threshold for Tooling API problem events
- Configuration cache report make issue line numbers easier to find even with many issues
- Configuation Cache breaks class reloading in IntelliJ
- Gradle does not produce TestNG reports always HOT 1
- Report JVM information for Gradle daemon
- On starting `GradleRunner` with assertions enabled
- Shadow plugin works incorrectly while depending on Nar packages
- TAPI out of memory in Team city agent
- Compiler problem reporting causes `IllegalArgumentException` with `Corretto-8.412.08.1` HOT 2
- Classloader issue related to `java.xml.bind` in ArtifactTransform HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradle.