Skip to content
This repository has been archived by the owner on Jul 17, 2022. It is now read-only.

New release needed. Broken compatibility with Gradle 6 #58

Open
marcodelpercio opened this issue Jan 24, 2020 · 6 comments
Open

New release needed. Broken compatibility with Gradle 6 #58

marcodelpercio opened this issue Jan 24, 2020 · 6 comments

Comments

@marcodelpercio
Copy link

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
Copy link

sghill commented Feb 20, 2020

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
Copy link

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
Copy link

wklaebe commented Jun 19, 2020

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
Copy link

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
Copy link

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 added a commit to jenkinsci/job-dsl-plugin that referenced this issue Oct 27, 2021
Releases were broken with the previous version of the JPI plugin [0],
therefore we needed to try upgrading to the latest version.

As the latest version requires Gradle 6, we have a few changes to make:

- `jenkinsVersion` needs to be referenced through `project.properties`
- the `war` plugin needs to be explicitly added
- the CSS/JS plugins we're using are not yet released[1][2], so we can
  follow the tricks in Spotless[3] to use the version from the (pinned)
  latest commit on GitHub

Next, as we're upgrading the JPI plugin, we need to:

- migrate to using `implementation` / `testImplementation`
- add Feature Variants for each of the `optionalJenkinsPlugins` -
  although I'm not sure if they're needed right now, we'll produce them
  for now and review later

See also https://groups.google.com/g/jenkinsci-dev/c/CDVvgj9dDMs

[0]: jenkinsci/gradle-jpi-plugin#192
[1]: eriwen/gradle-css-plugin#58
[2]: eriwen/gradle-js-plugin#177
[3]: https://github.com/diffplug/spotless/blob/a7f25eb51c6d4006591ea911157e62d0213e320b/CONTRIBUTING.md
@jamietanna
Copy link

Note that building the JAR yourself isn't necessarily required - see jenkinsci/job-dsl-plugin@6b7a8d8 for how I used the JitPack service

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants