Skip to content
Snippets Groups Projects
Select Git revision
  • 92b0d8f3cfbc981d4568f1a4bf7c2fb27739d2a2
  • develop default protected
  • master protected
  • 1.2.1
  • 1.2.0
  • 1.1.0
  • 1.0.5
  • 1.0.4
  • 1.0.3
  • 1.0.2
  • 1.0.0
11 results

build.gradle

  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    build.gradle 3.98 KiB
    plugins {
    	id 'java'
    	id 'eclipse'
    	id 'jacoco'
    	id "maven-publish"
    	id "signing"
    	id "de.undercouch.download" version "5.4.0"
    }
    
    project.version = '1.1.0-SNAPSHOT'
    project.group = 'de.hhu.stups'
    
    final isSnapshot = project.version.endsWith("-SNAPSHOT")
    
    repositories {
    	mavenCentral()
    	if (isSnapshot) {
    		maven {
    			name "sonatype snapshots"
    			url "https://oss.sonatype.org/content/repositories/snapshots"
    		}
    	}
    }
    
    configurations.all {
    	resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
    }
    
    def parser_version = '2.12.4-SNAPSHOT'
    
    dependencies {
    	//implementation(group: 'com.microsoft', name: 'tla2tools', version: '1.4.6')
    	implementation(group: 'commons-cli', name: 'commons-cli', version: '1.5.0')
    	implementation(group: 'de.hhu.stups', name: 'tlatools', version: '1.0.2')
    
    	implementation(group: 'de.hhu.stups', name: 'bparser', version: parser_version)
    	implementation(group: 'de.hhu.stups', name: 'ltlparser', version: parser_version)
    
    	testImplementation(group: 'junit', name: 'junit', version: '4.13.2')
    	testImplementation(group: 'de.hhu.stups', name: 'tla2bAST', version: '1.1.3')
    }
    
    java {
    	project.sourceCompatibility = JavaVersion.VERSION_1_8
    	project.targetCompatibility = JavaVersion.VERSION_1_8
    	
    	withSourcesJar()
    	withJavadocJar()
    }
    
    jacoco {
    	toolVersion = "0.8.7"
    	reportsDirectory = file("$buildDir/JacocoReports")
    }
    
    
    jacocoTestReport {
    	reports {
    		xml.required = false
    		csv.required = false
    		html.destination file("${buildDir}/jacocoHtml")
    	}
    }
    
    
    test {
    	exclude('de/tlc4b/tlc/integration/probprivate')
    	exclude('testing')
    	//exclude('de/tlc4b/tlc/integration')
    }
    
    task downloadPublicExamples(type: Download) {
    	src 'https://stups.hhu-hosting.de/downloads/prob/source/ProB_public_examples.tgz'
    	dest buildDir
    	onlyIfModified true
    }
    
    task extractPublicExamples(dependsOn: downloadPublicExamples, type: Copy) {
    	final outDir = "${buildDir}/prob_examples"
    	doFirst {
    		delete(outDir)
    	}
    	
    	from tarTree(resources.gzip("${buildDir}/ProB_public_examples.tgz"))
    	into outDir
    	include "public_examples/TLC/**"
    }
    
    clean {
    	delete "${projectDir}/public_examples" // now extracted into build, but previous versions placed it at top level
    	delete "${projectDir}/states"
    	delete "${projectDir}/temp"
    }
    
    task regressionTests(dependsOn: extractPublicExamples, type: Test) {
    	include('de/tlc4b/tlc/integration/probprivate/**')
    }
    check.dependsOn(regressionTests)
    
    // 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")
    }
    
    publishing {
    	publications {
    		mavenJava(MavenPublication) {
    			from components.java
    
    			pom {
    				name = "TLC integration into ProB"
    				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"
    					}
    				}
    			}
    		}
    	}
    
    	repositories {
    		maven {
    			final releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
    			final snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
    			url isSnapshot ? snapshotsRepoUrl : releasesRepoUrl
    			if (project.hasProperty("ossrhUsername") && project.hasProperty("ossrhPassword")) {
    				credentials {
    					username project.ossrhUsername
    					password project.ossrhPassword
    				}
    			}
    		}
    	}
    }
    
    ext."signing.secretKeyRingFile" = rootProject.file("secring.gpg").absolutePath
    
    signing {
    	sign publishing.publications.mavenJava
    }