Skip to content

Commit

Permalink
Updated the build script to use a version number from the application…
Browse files Browse the repository at this point in the history
….properties

Signed-off-by: Dmitriy Pavlenko <[email protected]>
  • Loading branch information
dmitriypdv committed Aug 27, 2015
1 parent 9cc8179 commit f561be8
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,36 @@ apply plugin: 'maven'
apply plugin: 'groovy'
apply plugin: 'idea'
apply plugin: 'signing'
group = 'com.sysgears.grain'
version = '0.7.0-SNAPSHOT'
defaultTasks 'build'

def mainClassName = 'com.sysgears.grain.Main'
def compatibilityVersion = 1.6
sourceCompatibility = compatibilityVersion
targetCompatibility = compatibilityVersion

buildscript {
repositories { mavenCentral() }
dependencies { classpath 'org.eclipse.jgit:org.eclipse.jgit:3.1.0.201310021548-r' }
}

ext {
applicationProperties = new Properties()
applicationProperties.load(new FileInputStream("$project.projectDir/src/main/resources/application.properties"))

grainVersion = applicationProperties.getProperty('grain.version')
if (!grainVersion) { throw new RuntimeException('Grain version is not set in the properties file') }

title = 'Grain Static Website Building Framework'
url = 'http://www.sysgears.com/grain'
licenseName = 'Apache License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
localGHPagesRepoDir = '../grain.gh-pages'
localGHPagesRepoCanonicalPath = new File(localGHPagesRepoDir).canonicalPath
javaCompatibilityVersion = 1.6
mainClassName = 'com.sysgears.grain.Main'
}

group = 'com.sysgears.grain'
version = project.grainVersion
sourceCompatibility = project.javaCompatibilityVersion
targetCompatibility = project.javaCompatibilityVersion

defaultTasks 'build'

configurations.all {
exclude group: 'commons-logging'
exclude group: 'rhino'
Expand All @@ -38,9 +45,6 @@ configurations {

repositories {
mavenCentral()
maven {
url 'http://repo.sysgears.com/releases/'
}
}

dependencies {
Expand Down Expand Up @@ -128,7 +132,7 @@ task createSharedManifest(dependsOn: getToolsMD5Checksum) {
'Built-Rev': project.toolsMD5,
'Built-Date': new Date(),
'Built-JDK': System.getProperty('java.version'),
'Main-Class': mainClassName
'Main-Class': project.mainClassName
}
}

Expand Down

0 comments on commit f561be8

Please sign in to comment.