Giter Site home page Giter Site logo

Comments (16)

alicederyn avatar alicederyn commented on May 23, 2024

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.

markelliot avatar markelliot commented on May 23, 2024

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.

alicederyn avatar alicederyn commented on May 23, 2024

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.

markelliot avatar markelliot commented on May 23, 2024
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.

markelliot avatar markelliot commented on May 23, 2024

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.

alicederyn avatar alicederyn commented on May 23, 2024

O.o omg

from gradle-processors.

markelliot avatar markelliot commented on May 23, 2024

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.

alicederyn avatar alicederyn commented on May 23, 2024

I'll leave this open and check there's nothing going wrong in the plugin. Thanks for figuring this out!

from gradle-processors.

punya avatar punya commented on May 23, 2024

Booooo Gradle.... I thought the whole point of the "declarative" plugins syntax was to obviate such considerations :(

from gradle-processors.

alicederyn avatar alicederyn commented on May 23, 2024

We may be doing something dodgy in the gradle-processors plugin, though.

from gradle-processors.

uschi2000 avatar uschi2000 commented on May 23, 2024

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.

alicederyn avatar alicederyn commented on May 23, 2024

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.

alicederyn avatar alicederyn commented on May 23, 2024

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.

jmcampanini avatar jmcampanini commented on May 23, 2024

could the ordering issues be avoided if we just do the work in an project.afterEvaluate block?

from gradle-processors.

alicederyn avatar alicederyn commented on May 23, 2024

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.

alicederyn avatar alicederyn commented on May 23, 2024

This is fixed in v1.2.3. Sorry for the delay, everyone!

from gradle-processors.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.