Skip to content

kkdt/eclipseone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This plugin is also available on the Gradle Plugin Repository.

eclipseone

This project uses the Eclipse Plugin to configure a multi-project Gradle build as a single-project view in the Eclipse IDE, without the use of the Eclipse Gradle Plugin.

The Gradle Plugin for Eclipse loads each subproject as a separate project within the IDE. With this Gradle plugin, a multiple-project view within Eclipse will look like the screen below (similar to IDEA's Gradle Plugin). In addition, you can keep your IDE lightweight and not have to install the Gradle Plugin.

alt text

Quick Start

  1. The master Gradle build file should have the follow snippet:
buildscript {
   repositories {
      maven {
         url 'https://github.com/kkdt/mavenrepo/raw/master'
      }
   }
   dependencies {
      classpath "kkdt.gradle.eclipseone:eclipseone:0.5"
   }
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'kkdt.gradle.eclipseone'
  1. Execute the Eclipse plugin as normal: gradle cleanEclipse eclipse

Overview

This plugin looks for Java subprojects and will configure their sources and library configurations into the root project's Eclipse Model. Because of this, the convention is as follows:

  1. The root project needs the Java plugin: apply plugin: 'java'
  2. The root project needs the Eclipse plugin: apply plugin: 'eclipse'
  3. Subprojects that include the Eclipse plugin will not include Eclipse artifacts (removed by this plugin)
  4. You will need to run gradle cleanEclipse eclipse again if configurations change (i.e. add a new compile configuration to a subproject)

Plugin Model: EclipseOneModel

EclipseOneModel is a project extension and is defined as follows:

eclipseone {
   jreContainerPath = null // i.e. 'org.eclipse.jdt.launching.JRE_CONTAINER'
   excludedJavaProjects = [] // Java projects to exclude from classpath
   ignoreExcludedJavaProjectsArtifacts = false // set to true to also ignore any jar artifacts from excluded java projects
}

Excluding Projects from Classpath

Suppose the baseline has a subproject that performs a wsimport or xjc that is taken care of by the build. The eclipseone model can be configured to exclude the source for that subproject in the IDE if its jar is referenced by another project.

Override JRE Container

Access restriction can occur when the baseline uses JRE sources when loading the baseline in Eclipse (see this StackOverflow thread). Override the jreContainerPath in the plugin model to use org.eclipse.jdt.launching.JRE_CONTAINER fixes this issue - the one generated by the Eclipe Plugin is something like

org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/

vs. (the overriden)

org.eclipse.jdt.launching.JRE_CONTAINER

Building

Publish to a Maven-style file repository.

gradle publish

Publish to local Maven (classpath dependencies would just be classpath "gradle.plugin.kkdt.gradle.eclipseone:eclipseone:0.5").

gradle publishToMavenLocal

About

Gradle Eclipse plugin generates a single baseline view

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages