Skip to content
Android style flavours in a java project
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle/wrapper
src
.gitignore
.travis.yml
LICENSE
README.md
build.gradle
gradlew
gradlew.bat
settings.gradle
version.txt

README.md

gradle-java-flavours Build Status Coverage Status

A Gradle plugin to add Android style flavours to a Java project

Usage:

plugins {
  id "com.lazan.javaflavours" version "1.2"
}
javaFlavours {
    flavour 'free'
    flavour 'paid'
    
    testJavaPathResolver = { String flavour -> "src/${flavour}-test/java" }
    testResourcesPathResolver = { String flavour -> "src/${flavour}-test/resources" }
}
dependencies {
    compile         'aaa:aaa:1.0'
    freeCompile     'bbb:bbb:2.0'
    freeTestCompile 'ccc:ccc:3.0'
    paidRuntime     'ddd:ddd:4.0'
}

You find detailed installation instructions at https://plugins.gradle.org/plugin/com.lazan.javaflavours.

Directories:

  • src/main/java - Common java sources
  • src/main/resources - Common resources
  • src/test/java - Common tests
  • src/test/resources - Common test resources
  • src/<flavour>/java - Flavour specific java sources (can be configured)
  • src/<flavour>/resources - Flavour specific resources (can be configured)
  • src/<flavour>Test/java - Flavour specific tests (can be configured)
  • src/<flavour>Test/resources - Flavour specific test resources (can be configured)

Tasks

  • compile<flavour>Java
  • compile<flavour>TestJava
  • <flavour>Classes
  • <flavour>Jar
  • <flavour>Test
  • <flavour>TestClasses
  • process<flavour>Resources
  • process<flavour>TestResources

Configurations:

  • <flavour>Compile
  • <flavour>CompileOnly
  • <flavour>CompileClasspath
  • <flavour>Runtime
  • <flavour>TestCompile
  • <flavour>TestCompileOnly
  • <flavour>TestCompileClasspath
  • <flavour>TestRuntime
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.