Skip to content
Snippets Groups Projects
Select Git revision
  • 34ef7e22bec52224394638c29060e60398537fc1
  • master default protected
  • release/1.1.4
  • release/1.1.3
  • release/1.1.1
  • 1.4.2
  • 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
21 results

build.gradle

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    build.gradle 3.24 KiB
    apply plugin: 'java-library'
    apply plugin: 'eclipse'
    apply plugin: 'maven-publish'
    apply plugin: 'jacoco'
    apply plugin: 'signing'
    
    project.version = '1.1.4-SNAPSHOT'
    project.group = 'de.hhu.stups'
    project.archivesBaseName = "tla2bAST"
    final isSnapshot = project.version.endsWith("-SNAPSHOT")
    
    project.sourceCompatibility = '1.8'
    project.targetCompatibility = '1.8'
    
    wrapper {
    	gradleVersion = "6.8.3"
    	distributionType = Wrapper.DistributionType.ALL
    }
    
    repositories {
    	mavenCentral()
    	maven {
    		name "sonatype snapshots"
    		url "https://oss.sonatype.org/content/repositories/snapshots"
    	}
    }
    
    configurations.all {
    	resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
    }
    
    def parser_version
    if (isSnapshot) {
    	parser_version = '2.9.28-SNAPSHOT'
    }
    else {
    	parser_version = '2.9.27'
    }
    
    def tlatools_version = '1.0.2'
    
    dependencies {
    	implementation(group: 'commons-cli', name: 'commons-cli', version: '1.4')
    	api(group: 'de.hhu.stups', name: 'tlatools', version: tlatools_version)
    	api(group: 'de.hhu.stups', name: 'prologlib', version: parser_version)
    	api(group: 'de.hhu.stups', name: 'bparser', version: parser_version)
    
    	testImplementation(group: 'junit', name: 'junit', version: '4.12')
    }
    
    java {
    	withSourcesJar()
    	withJavadocJar()
    }
    
    jacoco {
    	toolVersion = "0.8.6"
    	reportsDirectory = 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){
    	archiveFileName = 'TLA2B.jar'
    	//from sourceSets.main.allJava
    	from sourceSets.main.output
    	from {configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
    	exclude('**/*.java')
    	manifest {
    		attributes "Main-Class" : 'de.tla2b.TLA2B'
    	}
    }
    
    publishing {
    	publications {
    		mavenJava(MavenPublication) {
    			from components.java
    
    			pom {
    				name = 'TLA+ to B-AST'
    				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:https://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'
    					}
    				}
    			}
    		}
    	}
    
    	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
    				}
    			}
    		}
    	}
    }
    
    signing {
    	sign publishing.publications.mavenJava
    }