
// Renjin Root project
// The settings here are inherited by all subprojects


// Declare the dependencies of the gradle build scripts
// themselves.

buildscript {
  repositories {
    maven { url "https://plugins.gradle.org/m2/" }
    maven { url "https://nexus.bedatadriven.com/content/groups/public" }
  }
  dependencies {
    classpath "gradle.plugin.nl.javadude.gradle.plugins:license-gradle-plugin:0.14.0"
    classpath "org.owasp:dependency-check-gradle:4.0.2"
    classpath "com.netflix.nebula:gradle-ospackage-plugin:8.4.1"
  }
}

// For resolving actual project dependencies, use only our local maven repo and BeDataDriven's nexus repository,
// which proxies maven central as well as other upstream repositories.

allprojects {
  repositories {
    mavenLocal()
    mavenCentral()
    maven {
      url "https://nexus.bedatadriven.com/content/groups/public"
    }
  }
}

ext {
    gccBridgePlugin = "$projectDir/tools/gcc-bridge/compiler/build/bridge.so"
    gnuHomeDir = rootProject.file('tools/gnur-installation/src/main/resources')

}

allprojects {
    group = 'org.renjin'
    version = '3.5'
}

subprojects {

    configurations.all {
        exclude group: 'org.slf4j', module: 'slf4j-simple'
    }
}


ext.majorVersion = "3.5"
def renjinVersion;
if(System.getenv("RENJIN_RELEASE")) {
    renjinVersion = System.getenv("RENJIN_RELEASE")
} else if(System.getenv("BUILD_NUMBER")) {
    renjinVersion = "3.5-beta${System.getenv("BUILD_NUMBER")}"
} else {
    renjinVersion = "3.5-dev"
}

allprojects {
  project.version = renjinVersion
}

// Define common configuration properties and
// apply cross-project processes.

apply from: "./gradle/libraries.gradle"
apply from: "./gradle/java.gradle"
apply from: "./gradle/upstream.gradle"

// Defines the version based on our major version and the environment

subprojects {
    
    task cleanMaven(type: Delete) {
        delete 'target'
    }
    
    clean.dependsOn cleanMaven
}