Skip to content
Snippets Groups Projects
Select Git revision
  • master default protected
  • release/1.1.4
  • release/1.1.3
  • release/1.1.1
  • 1.4.1
  • 1.4.0
  • 1.3.0
  • 1.2.1
  • 1.2.0
  • 1.1.5
  • 1.1.4
  • 1.1.3
  • 1.1.1
  • 1.1.0
  • 1.0.9
  • 1.0.8
  • 1.0.7
  • v1.0.5
  • 1.0.5
19 results

build.gradle

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    build.gradle 3.72 KiB
    apply plugin: 'java'
    apply plugin: 'eclipse'
    apply plugin: 'maven'
    apply plugin: 'jacoco'
    
    project.version = '1.1.3-SNAPSHOT'
    project.group = 'de.hhu.stups'
    project.archivesBaseName = "tla2bAST"
    
    project.sourceCompatibility = '1.7'
    project.targetCompatibility = '1.7'
    
    wrapper {
    	gradleVersion = "5.6.2"
    	distributionType = Wrapper.DistributionType.ALL
    }
    
    repositories {
    	mavenCentral()
    	maven {
    		name "sonatype snapshots"
    		url "https://oss.sonatype.org/content/repositories/snapshots"
    	}
    	maven {
    		name "sonatype releases"
    		url "https://oss.sonatype.org/content/repositories/releases"
    	}
    }
    
    configurations.all {
    	resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
    }
    
    def parser_version
    if (project.version.endsWith("-SNAPSHOT")) {
    	parser_version = '2.9.18-SNAPSHOT'
    }
    else {
    	parser_version = '2.9.17'
    }
    
    def tlatools_version = '1.0.2'
    
    dependencies {
    	compile (group: 'commons-cli', name: 'commons-cli', version: '1.4')
    	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)
    
    	testCompile (group: 'junit', name: 'junit', version: '4.12')
    }
    
    jacoco {
    	toolVersion = "0.8.5"
    	reportsDir = file("$buildDir/customJacocoReportDir")
    }
    
    // type 'gradle tla2b 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")
    }
    
    test {
    	exclude('testing')
    	//allJvmArgs = [ "-Xss515m" ]
    }
    
    
    task createJar(type: Jar, dependsOn: classes){
    	archiveName = 'TLA2B.jar'
    	//from sourceSets.main.allJava
    	from sourceSets.main.output
    	from {configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
    	exclude('**/*.java')
    	manifest {
    		attributes "Main-Class" : 'de.tla2b.TLA2B'
    	}
    }
    
    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 'TLA+ to B-AST'
    					packaging 'jar'
    					// optionally artifactId can be defined here
    					description "Translator from TLA+ to ProB's AST representation."
    					url 'https://github.com/hhu-stups/tla2bAST'
    
    					licenses {
    						license {
    							name 'Eclipse Public License, Version 1.0'
    							url 'https://www.eclipse.org/legal/epl-v10.html'
    						}
    					}
    
    					scm {
    						connection 'scm:git:git://github.com/hhu-stups/tla2bAST.git'
    						developerConnection 'scm:git:git@github.com:hhu-stups/tla2bAST.git'
    						url 'https://github.com/hhu-stups/tla2bAST'
    					}
    
    
    					developers {
    						developer {
    							id 'bendisposto'
    							name 'Jens Bendisposto'
    							email 'jens@bendisposto.de'
    						}
    					}
    				}
    			}
    		}
    	}
    }