Skip to content
Snippets Groups Projects
Select Git revision
  • b76069dca57768705546acbd2c0e482ea1166cfc
  • develop default protected
  • master protected
  • 1.2.2
  • 1.2.1
  • 1.2.0
  • 1.1.0
  • 1.0.5
  • 1.0.4
  • 1.0.3
  • 1.0.2
  • 1.0.0
12 results

build.gradle

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    build.gradle 4.59 KiB
    apply plugin: 'java'
    apply plugin: 'eclipse'
    apply plugin: 'maven'
    apply plugin: 'jacoco'
    apply plugin: 'findbugs'
    
    project.version = '1.0.4-SNAPSHOT'
    project.group = 'de.hhu.stups'
    
    project.sourceCompatibility = '1.7'
    project.targetCompatibility = '1.7'
    
    repositories {
      mavenCentral()
        maven {
          name "sonatype snapshots"
          url "https://oss.sonatype.org/content/repositories/snapshots"
        }
    }
    
    configurations.all {
     resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
    }
    
    def parser_version = '2.9.12'
    def tlatools_version = '1.0.2'
    
    dependencies {
    	//compile (group: 'com.microsoft', name: 'tla2tools', version: '1.4.6')
    	compile 'commons-cli:commons-cli:1.2'
    	compile (group: 'de.hhu.stups', name: 'tlatools', version: tlatools_version)
    
    	compile (group: 'de.hhu.stups', name: 'prologlib', version: parser_version)
    	compile (group: 'de.hhu.stups', name: 'parserbase', version: parser_version)
    	compile (group: 'de.hhu.stups', name: 'bparser', version: parser_version)
    	compile (group: 'de.hhu.stups', name: 'ltlparser', version: parser_version)
    
    	//compile(group: 'de.hhu.stups', name: 'de.prob.core.kernel', version: '2.0.0-milestone-13-SNAPSHOT')
    
    	testCompile (group: 'junit', name: 'junit', version: '4.12')
    	testCompile (group: 'de.hhu.stups', name: 'tla2bAST', version: '1.1.0')
    }
    
    jacoco {
        toolVersion = "0.7.1.201405082137"
        reportsDir = file("$buildDir/JacocoReports")
    }
    
    jacocoTestReport {
        reports {
            xml.enabled false
            csv.enabled false
            html.destination "${buildDir}/jacocoHtml"
        }
    }
    
    
    test {
    	exclude('de/tlc4b/tlc/integration/probprivate')
    	exclude('testing')
    	//exclude('de/tlc4b/tlc/integration')
    }
    
    
    task regressionTests(type: Test){
    	doFirst{ println("Running integration tests") }
    	scanForTestClasses = true
    	//include('de/tlc4b/tlc/integration/probprivate/**')
    	include('de/tlc4b/**')
    }
    
    // type 'gradle integrationTests jacocoIntegrationTestReport' in order to run the jacoco code coverage analysis
    task jacocoIntegrationTestReport(type: JacocoReport) {
    	sourceSets sourceSets.main
    	//executionData files('build/jacoco/integrationTests.exec')
    	executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")
    }
    
    tasks.withType(FindBugs) {
    	// disable findbugs by default
    	// in order to run findbugs type 'gradle build findbugsMain findbugsTest'
    	task -> enabled = gradle.startParameter.taskNames.contains(task.name)
    
        reports {
            xml.enabled = false
            html.enabled = true
        }
    
    	ignoreFailures = true
    }
    
    task createJar(type: Jar, dependsOn: build){
    	archiveName = 'TLC4B.jar'
    	from sourceSets.main.output
    	from {configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
    	exclude('**/*.java')
    	manifest {
    		attributes "Main-Class" : 'de.tlc4b.TLC4B'
    	}
    }
    
    
    if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')) {
    
    apply plugin: 'signing'
    
    signing {
        sign configurations.archives
    }
    
    javadoc {
    	failOnError = false
    }
    
    task javadocJar(type: Jar) {
    	 classifier = 'javadoc'
    	 from javadoc
    }
    
    task sourcesJar(type: Jar) {
    	 classifier = 'sources'
    	 from sourceSets.main.allSource
    }
    
    artifacts {
    	 archives javadocJar, sourcesJar
    }
    
    uploadArchives {
      repositories {
        mavenDeployer {
          beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
    
          repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
            authentication(userName: ossrhUsername, password: ossrhPassword)
          }
    
          snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
            authentication(userName: ossrhUsername, password: ossrhPassword)
          }
    
          pom.project {
            name 'TLC integration into ProB'
            packaging 'jar'
            // optionally artifactId can be defined here
            description "Use the TLC model checker within ProB."
            url 'https://github.com/hhu-stups/tlc4b'
    
            licenses {
              license {
                name 'Eclipse Public License, Version 2.1'
                url 'https://www.eclipse.org/legal/epl-v10.html'
              }
            }
    
            scm {
              connection 'scm:git:git://github.com/hhu-stups/tlc4b.git'
              developerConnection 'scm:git:git@github.com:hhu-stups/tlc4b.git'
              url 'https://github.com/bendisposto/hhu-stups/tlc4b'
            }
    
    
            developers {
              developer {
                id 'bendisposto'
                name 'Jens Bendisposto'
                email 'jens@bendisposto.de'
              }
            }
          }
        }
      }
    }
    }