Skip to content
Snippets Groups Projects
Select Git revision
  • 0fc0a1f644ae67e2259bc94a6ea53e40237a2755
  • 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 2.44 KiB
    apply plugin: 'application'
    apply plugin: 'java'
    apply plugin: 'eclipse'
    apply plugin: 'maven-publish'
    apply plugin: 'signing'
    
    
    project.version = '3.2.14-SNAPSHOT'
    project.group = 'de.hhu.stups'
    project.archivesBaseName = "sablecc"
    
    wrapper {
      gradleVersion = "6.3"
      distributionType = Wrapper.DistributionType.ALL
    }
    
    final isSnapshot = project.version.endsWith("-SNAPSHOT")
    
    sourceCompatibility = 7
    targetCompatibility = 7
    
    repositories {
      mavenLocal()
      jcenter()
    }
    
    mainClassName = "org.sablecc.sablecc.SableCC"
    
    java {
      withSourcesJar()
      withJavadocJar()
    }
    
    jar {
      manifest {
        attributes 'Main-Class': mainClassName
      }
    }
    
    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']
    }
    
    publishing {
      publications {
        mavenJava(MavenPublication) {
          from components.java
    
          pom {
            name = 'SableCC - Stups fork'
            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'
              }
            }
          }
        }
      }
    
      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
    }