Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
import java.util.regex.Matcher
import java.util.regex.Pattern
// --------------- Plugins ---------------
plugins {
// https://plugins.gradle.org/plugin/org.dyvil.dyvil-gradle
id 'org.dyvil.dyvil-gradle' version '0.4.0' apply false
// https://plugins.gradle.org/plugin/com.jfrog.bintray
id 'com.jfrog.bintray' version '1.8.5' apply false
// https://plugins.gradle.org/plugin/de.clashsoft.simple-publish
id 'de.clashsoft.simple-publish' version '0.6.0' apply false
}
// *************** Shared Configuration ***************
wrapper.setDistributionType(Wrapper.DistributionType.ALL)
// --------------- Constants ---------------
ext {
libraryDependency = 'org.dyvil:library:0.47.0'
compilerDependency = 'org.dyvil:compiler:0.47.1'
gensrcDependency = 'org.dyvil:gensrc:0.11.1'
versionDir = 'v0.4x'
javaFilters = [ '**/*.java' ]
dyvilFilters = [ '**/*.dyv', '**/*.dyh', '**/*.dyvil', '**/*.dyvilh' ]
genSrcFilters = [ '**/*.dgt', '**/*.dgs', '**/*.dgc', '**/*.dgh' ]
binaryFilters = [ '**/*.dyo', '**/*.class' ]
resourceFilters = [ '**/*.properties' ]
getTagVersion = this.&getTagVersion
}
private static String getTagVersion(String module = '') {
if (!module.isEmpty() && !module.endsWith("/")) {
module += '/'
}
final String tagOutput = 'git tag --sort=-version:refname'.execute().text
final Pattern pattern = Pattern.compile("^${ module }v(.*)\$", Pattern.MULTILINE)
final Matcher matcher = pattern.matcher(tagOutput)
if (!matcher.find()) {
throw new IllegalStateException("failed to find /$pattern/ in output:\n$tagOutput")
}
final String newestTag = matcher.group(0)
final String newestVersion = matcher.group(1)
if (System.getenv("DYVIL_RELEASE")) {
return newestVersion
}
final String commitCount = "git rev-list $newestTag.. --count".execute().text.trim()
if (commitCount == "0") {
return newestVersion
}
final String commitID = 'git rev-parse --short HEAD'.execute().text.trim()
return newestVersion + '-' + commitCount + '-' + commitID
}
allprojects {
apply from: rootProject.file('shared.build.gradle')
}
// *************** Configuration for Root Project ***************
// --------------- Plugins ---------------
apply plugin: 'org.dyvil.dyvil-gradle'
// --------------- Info ---------------
version = getTagVersion()
description = 'The Dyvil programming language.'
publishInfo.labels = [ 'dyvil', 'programming-language', 'jvm' ]
// --------------- Dependencies ---------------
dependencies {
compile subprojects
// --------------- Test ---------------
// https://mvnrepository.com/artifact/junit/junit
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile project(':library').sourceSets.main.runtimeClasspath
}
// --------------- Test Tasks ---------------
tasks.named('compileTestDyvil') {
// override classpath to use the new compiler instead of bootstrap
dyvilcClasspath = project(':compiler').sourceSets.main.runtimeClasspath
}
tasks.named('compileTestDyvilGenSrc') {
// override classpath to use the new classes instead of bootstrap
dyvilcClasspath = project(':gensrc').sourceSets.main.runtimeClasspath
}
// --------------- Jar ---------------
jar.doFirst {
manifest.attributes("Main-Class": project(':repl').mainClassName)
}