Comments (16)
That's really weird. Can you give me more details about your setup — Gradle version, Eclipse version, plugin version? (Ideally attach a repro zip, if you have time.)
from gradle-processors.
Tried with:
- Gradle 2.6 and 2.7
- Eclipse Mars
- Processors 1.1
In case it matters, I was trying to use org.immutables:value:2.0.21.
The failing setup looked like:
plugins {
id 'eclipse'
id 'java'
id 'org.inferred.processors' version '1.1'
}
group 'group'
repositories {
jcenter()
}
dependencies {
processor 'org.immutables:value:2.0.21'
}
And the working setup like:
buildscript {
repositories {
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'gradle.plugin.org.inferred:gradle-processors:1.1'
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.inferred.processors'
group 'group'
repositories {
jcenter()
}
dependencies {
processor 'org.immutables:value:2.0.21'
}
from gradle-processors.
Could you post the output of
cat gradle/wrapper/gradle-wrapper.properties
(Sorry, just want to double-check there are no weird modified Gradles being pulled in somehow.)
from gradle-processors.
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-bin.zip
from gradle-processors.
Ok, I think I found it; apparently the order in plugins
matters:
fails to fix classpath:
plugins {
id 'eclipse'
id 'java'
id 'org.inferred.processors' version '1.1'
}
correct classpath:
plugins {
id 'java'
id 'eclipse'
id 'org.inferred.processors' version '1.1'
}
from gradle-processors.
O.o omg
from gradle-processors.
Yeah, worse yet, if I mutate the working version to swap eclipse for baseline, things fail again (baseline-eclipse applies the eclipse plugin):
plugins {
id 'java'
id 'com.palantir.baseline-eclipse' version '0.1.1'
id 'org.inferred.processors' version '1.1'
}
...but I'll follow up with @uschi2000 about that.
Anyway, short of filing a Gradle bug I don't think there's things to be done here.
from gradle-processors.
I'll leave this open and check there's nothing going wrong in the plugin. Thanks for figuring this out!
from gradle-processors.
Booooo Gradle.... I thought the whole point of the "declarative" plugins
syntax was to obviate such considerations :(
from gradle-processors.
We may be doing something dodgy in the gradle-processors plugin, though.
from gradle-processors.
In the plugins{} syntax, when is Plugin#apply expected to run? I don't think order independence can work once plugins extend behaviour of others.
from gradle-processors.
We take the approach of installing a task that runs after the java/eclipse/etc plugin runs. It may be there is an ordering issue happening there, I suppose.
from gradle-processors.
Sorry it's taken me so long to address this. I was bamboozled by being apparently unable to replicate it with apply plugin
, which is necessary for testing. It turns out the order plugins are applied with the plugins {}
syntax is non-trivial. The example given was:
plugins {
id 'eclipse'
id 'java'
id 'org.inferred.processors' version '1.1'
}
This appears to be equivalent to:
apply plugin: 'org.inferred.processors'
apply plugin: 'eclipse'
apply plugin: 'java'
or possibly:
apply plugin: 'eclipse'
apply plugin: 'org.inferred.processors'
apply plugin: 'java'
Weird.
from gradle-processors.
could the ordering issues be avoided if we just do the work in an project.afterEvaluate
block?
from gradle-processors.
Sadly, no, we need to do the work before the project is evaluated. I have a PR in review that fixes the issue, though.
from gradle-processors.
This is fixed in v1.2.3. Sorry for the delay, everyone!
from gradle-processors.
Related Issues (20)
- Plugin should forward processor compiler options (-Akey=value)
- Upgrade to processors 3.1.0 from 3.0.1 caused certain annotation processors to no longer appear on classpath
- Deprecation warning: "configuration foo was resolved without accessing the project in a safe manner"
- Immutables processor writes to generated_src and is not clean friendly
- should use a different method to exclude generated classes from FindBugs HOT 2
- Ignoring Immutables not working with latest Baseline findbugs HOT 2
- Intellij 2016.3 Caused by: groovy.lang.GroovyRuntimeException: replaceNode() can only be used to replace a single node. HOT 2
- Could not get unknown property 'idea' for root project HOT 20
- org.eclipse.jdt.apt.genSrcDir sets to bin/generated/java in eclipse apt prefs since 1.2.4 HOT 2
- Bad generated_src folder in IntelliJ HOT 9
- IntelliJ thinks our modules have cycles HOT 3
- Inverse of #58 HOT 6
- IDEA-originated imports for multi-project builds broken [IDEA 2017.1.5] HOT 17
- Provide ability to specify Processors HOT 4
- Incorrect output directory for eclipse projects on Windows for 1.2.12 HOT 2
- FindBugs GeneratedClassesJar task issues when run in parallel with the test task HOT 1
- Run annotation processors as part of the gradle idea task HOT 5
- Intellji 2017.3.1 no longer generates Immutable classes to `generated_src` HOT 4
- Deprecation warning using recent Gradle 4.4.1
- Processors 2.0.0 do not work well with immutables HOT 3
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-processors.