eriwen / gradle-css-plugin

Gradle plugin for working with CSS
http://eriwen.github.com/gradle-css-plugin
Apache License 2.0
127 stars 42 forks source link

New release needed. Broken compatibility with Gradle 6 #58

Open marcodelpercio opened 4 years ago

marcodelpercio commented 4 years ago

If you try to use the plugin with Gradle 6 just by declaring it in the plugin block it will not work. The change is actually fixed in master but without a release everyone is forced to manually build the plugin by himself and import the jar the classpath.

It's been a very long time since the latest release however I see commits are happening.

sghill commented 4 years ago

Hi @eriwen,

Are there plans for a release with Gradle 6 compatibility?

I see 6.0 was released 2019-11-08 from the Gradle versions endpoint. Looking forward to upgrading this plugin when available, but it'd also be useful to know if a new release isn't planned.

616slayer616 commented 4 years ago

I have given up on waiting and created my own plugin for minification of css and js. If you need minification it might help you

wklaebe commented 4 years ago

I'd like to upgrade our project to Gradle 6.5, but we use this plugin. Is there anything left to be done for a release?

gbalthasar commented 4 years ago

Yes, unfortunatly the master is broken for using with gradle 6+. I got it running with gradle 6.6.1 actually by cloning the repository, building manually, modify one file, upload to my local nexus and modify my build script (i also did this for the .js plugin, but that just needed a new build from master without modifications.

  1. clone
  2. edit build.gradle and update version to "2.14.1"
  3. edit src/main/groovy/com/eriwen/gradle/css/source/internal/DefaultCssSourceSet.groovy

Modify first if to

        if (GradleVersion.current().compareTo(GradleVersion.version("5.0")) >= 0) {
            this.css = project.objects.sourceDirectorySet(name, String.format("%s CSS source", displayName))
        } else if (GradleVersion.current().compareTo(GradleVersion.version("2.12")) >= 0) {
        ...
  1. gradlew -x test build
  2. Upload created lib to your nexus, using coordinates "com.eriwen:gradle-css-plugin:2.14.1"
  3. Update your build script

Attention! Include your own Nexus in buildscript repositories for this to work! Alternative is to put the jar into file system and use classpath file(...) to include to jars(s)

// --- Buildscript must be first

buildscript {
  repositories {
        mavenCentral()
        jcenter()
        // your Nexus
  }
  dependencies {

    // Attention! Updates to manually built/modify versions (uploaded at nexus) 

    // cloned and built only: see https://github.com/eriwen/gradle-js-plugin/issues/177
    classpath "com.eriwen:gradle-js-plugin:2.14.2"

    // cloned and modified: see https://github.com/eriwen/gradle-css-plugin/issues/58
    classpath "com.eriwen:gradle-css-plugin:2.14.1"

    classpath 'com.google.javascript:closure-compiler:v20160208', {
        exclude module: 'junit'
    }
    classpath 'com.yahoo.platform.yui:yuicompressor:2.4.8', {
        exclude module: 'junit'
    }
  }
}
...

Have fun!

lucashby commented 4 years ago

I see there's already a PR to resolve this. Couldn't someone just review it and accept it if it's good to go?

jamietanna commented 2 years ago

Note that building the JAR yourself isn't necessarily required - see https://github.com/jenkinsci/job-dsl-plugin/commit/6b7a8d813c3c3b9f5daf0fcee823c9fd128d8f42 for how I used the JitPack service