Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash in LocalizerTask #71

Merged
merged 1 commit into from
Mar 22, 2016
Merged

Fix crash in LocalizerTask #71

merged 1 commit into from
Mar 22, 2016

Conversation

korniltsev
Copy link

In gradle a plugin dependency may be declared in one project, but applied in another one.

In this case LocalizerTask may crash, because buildscript may not have org.jvnet.localizer:maven-localizer-plugin on the classpath.

Example:
build.gradle -   dependencies { classpath 'org.jenkins-ci.tools:gradle-jpi-plugin:0.15.0' }
my_plugin/build.gradle - apply plugin: 'org.jenkins-ci.jpi'

For more information see JpiLocalizerTaskIntegrationTest.

In order to fix the problem I've rewritten LocalizerTask to call org.jvnet.localizer.GeneratorTask directly without IsolatedAntBuilder.

This PR contains:

  • An integration test to demonstrate the problem
  • Fix for the problem as a second commit
  • I've changed org.jvnet.localizer:maven-localizer-plugin version to 1.12 because 1.13 is not available on maven central.
  • I've updated gradle wrapper to version 2.8 to be able to create integration tests.

@jenkinsadmin
Copy link
Member

Thank you for this pull request! Please check this document for how the Jenkins project handles pull requests.

@@ -19,7 +19,7 @@ sourceCompatibility = '1.6'

dependencies {
compile gradleApi()
compile 'org.jvnet.localizer:maven-localizer-plugin:1.13'
compile 'org.jvnet.localizer:maven-localizer-plugin:1.12'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not downgrade the version, the artifact is in http://repo.jenkins-ci.org/releases/ which is the official repo for all Jenkins related artifacts

@daspilker
Copy link
Member

OK, cool. Gradle 2.13 will provide a better TestKit, which will not require so much boilerplate code. See gradle/gradle@5be4cd0#diff-5c5d96f87fb425d3fe3bc2400a400a4c. But for now, it's OK. Can you squash your commits and force push?

Add a test to demonstrate a crash in LocalizerTask on projects with multiple modules
Update gradle wrapper to 2.8 to be able to use gradleTestKit()
Fix crash when org.jvnet.localizer:maven-localizer-plugin is not on the
classpath of buildScript (Rewrite LocalizerTask to call GeneratorTaski
directly without IsolatedAntBuilder. See
JpiLocalizerTaskIntegrationTest."multi-module project should be able to run LocalizerTask"
@daspilker daspilker merged commit 0b97dc2 into jenkinsci:master Mar 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants