Skip to content

A small gradle plugin that adds a Java source set for generated code.

License

Notifications You must be signed in to change notification settings

romasch/gradle-generated-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gradle-generated-code

A small gradle plugin that adds a Java source set for generated code.

Basically, it does the following things:

  • Defines a new source set in src/gen/java
  • Add dependencies from the main java sources to the generated code
  • Hook into the clean task to automatically delete all generated sources.
  • If the idea module is present, it also marks src/gen/java as a generated source folder.

On its own the plugin is not really useful, but it can be used by other Java code generator plugins:

class MyPlugin implements Plugin<Project> {

    void apply(Project project) {
        project.apply (plugin: 'ch.romasch.gradle.generated-code')
        project.generate.dependsOn project.tasks.withType(MyPluginTask)
    }
}

How to use it

Currently the plugin is not published or registered anywhere. To use it locally:

  • git clone the repository
  • ./gradlew build install
  • In your own plugin, add the following to your build.gradle:
repositories {
    mavenLocal()
    // ...
}

dependencies {
    compile 'ch.romasch.gradle:generated-code:1.0-SNAPSHOT'
    // ...
}

About

A small gradle plugin that adds a Java source set for generated code.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages