subprojects {

    apply plugin: 'java'
    apply plugin: 'eclipse'
    apply plugin: 'idea'
    apply plugin: 'osgi'
    apply plugin: 'maven'
    apply from  : '../mavenPublish.gradle'

    Properties cfg = new Properties()
    cfg.load(new FileInputStream("$rootDir/controlsfx-build.properties"))
	
    ext {
      artifact_suffix       = cfg.artifact_suffix
      specification_title   = cfg.controlsfx_specification_title  //'Java 8u20'
      specification_version = cfg.controlsfx_specification_version //'8.20.7'
      controlsfx_name       = 'controlsfx'
      fxsampler_name        = 'fxsampler'
      fxsampler_version     = cfg.fxsampler_specification_version + artifact_suffix
      fxsampler_mainClass   = 'fxsampler.FXSampler'
    }


    group = 'org.controlsfx'
    version = specification_version + artifact_suffix

    sourceCompatibility = '1.8'
    targetCompatibility = '1.8'

    repositories {
       mavenCentral()
    }

    dependencies {
       testCompile 'junit:junit:[4,)'
    }

    test {
       testLogging {
        // Show that tests are run in the command-line output
           events 'started', 'passed'
       }
    }

    compileJava {
        options.encoding = "UTF-8"
        options.incremental = true
    }

    task sourceJar(type: Jar) {
        from sourceSets.main.java
        from sourceSets.main.resources
        classifier = 'sources'
    }

    task javadocJar(type: Jar) {
        dependsOn javadoc
        from javadoc.destinationDir
        classifier = 'javadoc'
    }

    artifacts {
        archives sourceJar
        archives javadocJar
    }

}
