Skip to content
Snippets Groups Projects
Select Git revision
  • 055c85e7304b25de985ba2589f9fb8caaa74bccb
  • develop default protected
  • master protected
  • kristin_optim_test
  • 3.9.0
  • 3.8.0
  • 3.7.0
  • 3.6.0
  • 3.5.0
  • 3.4.1
  • 3.4.0
  • 3.3.3
  • 3.3.2
  • 3.3.0
  • 3.2.14
  • 3.2.13
  • 3.2.12
17 results

build.gradle

  • user avatar
    Jens Bendisposto authored
    01a69b11
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    build.gradle 2.54 KiB
    apply plugin: 'java'
    apply plugin: 'eclipse'
    apply plugin: 'maven'
    
    
    project.version = '3.2.11-SNAPSHOT'
    project.group = 'de.hhu.stups'
    project.archivesBaseName = "sablecc"
    
    allprojects {
        sourceCompatibility = 1.5
        targetCompatibility = 1.5
    }
    
    dependencies {
     testCompile 'junit:junit:4.8.2'
    }
    
    
    task javadocJar(type: Jar) {
        classifier = 'javadoc'
        from javadoc
    }
    
    task sourcesJar(type: Jar) {
        classifier = 'sources'
        from sourceSets.main.allSource
    }
    
    jar {
    	manifest {
    		attributes 'Main-Class': 'org.sablecc.sablecc.SableCC'
    	}
    }
    
    artifacts {
        archives javadocJar, sourcesJar
    }
    
    task writeVersion() {
    
      doFirst {
      def buildconstants_class = """
      package org.sablecc.sablecc;
    
      public class Version
      {
        public static final String VERSION = "${project.version}";
      }
      """
      File f = file("src/main/java/org/sablecc/sablecc/Version.java")
      f.delete()
      f <<  buildconstants_class
     }
    }
    
    compileJava {
      dependsOn = ['writeVersion']
    }
    
    task deploy(dependsOn: [jar,test,javadoc], group: 'Build')
    
    if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')) {
    
    apply plugin: 'signing'
    
    signing {
        sign configurations.archives
    }
    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 'SableCC - Stups fork'
            packaging 'jar'
            // optionally artifactId can be defined here
            description 'This version of SableCC enriches the abstract syntax tree with information about tokens.'
            url 'https://github.com/bendisposto/sablecc-stups'
    
            licenses {
              license {
                name 'GNU Lesser General Public License, Version 2.1'
                url 'http://www.gnu.org/licenses/lgpl-2.1.html'
              }
            }
    
            scm {
              connection 'scm:git:git://github.com/bendisposto/sablecc-stups.git'
              developerConnection 'scm:git:git@github.com:bendisposto/sablecc-stups.git'
              url 'https://github.com/bendisposto/sablecc-stups'
            }
    
    
            developers {
              developer {
                id 'bendisposto'
                name 'Jens Bendisposto'
                email 'jens@bendisposto.de'
              }
            }
          }
        }
      }
    }
    }