Skip to content
Snippets Groups Projects
Commit 245a46c4 authored by User expired's avatar User expired
Browse files

Increased version number

parent 4d4744f5
No related branches found
No related tags found
No related merge requests found
// Plugin declaration
plugins {
id 'com.bmuschko.vagrant' version '2.0'
id 'com.kageiit.url-cache' version '1.0.0'
id 'org.ajoberstar.grgit-release' version '0.10.0'
}
apply plugin: 'eclipse'
import org.ajoberstar.grgit.*
import org.apache.tools.ant.filters.FixCrLfFilter
import org.apache.tools.ant.filters.ReplaceTokens
// Basic settings
group = 'at.uibk.dbis'
version = '0.4.0-SNAPSHOT'
description = 'PhD project of Nikolaus Krismer (infrastructure as vagrantbox)'
ext {
vagrantDir = getProjectDir()
}
// Groovy method declaration
def getDate() {
def date = new Date()
def formattedDate = date.format('yyyyMMdd')
return formattedDate
}
// Detailled settings (dependencies, tasks, task configuration, ...)
eclipse {
project {
natures = [
'org.springsource.ide.eclipse.gradle.core.nature'
]
file {
withXml { xmlProvider ->
Node project = xmlProvider.asNode()
Node filteredResources = project.appendNode('filteredResources');
Node filterGit = filteredResources.appendNode('filter')
filterGit.appendNode('id', 1421146667415)
filterGit.appendNode('name', '')
filterGit.appendNode('type', 30)
Node matcherGit = filterGradle.appendNode('matcher')
matcherGit.appendNode('id', 'org.eclipse.ui.ide.multiFilter')
matcherGit.appendNode('arguments', '1.0-name-matches-false-false-.git')
Node filterGradle = filteredResources.appendNode('filter')
filterGradle.appendNode('id', 1392635165065)
filterGradle.appendNode('name', '')
filterGradle.appendNode('type', 30)
Node matcherGradle = filterGradle.appendNode('matcher')
matcherGradle.appendNode('id', 'org.eclipse.ui.ide.multiFilter')
matcherGradle.appendNode('arguments', '1.0-name-matches-false-false-.gradle')
Node filterVagrant = filteredResources.appendNode('filter')
filterVagrant.appendNode('id', 1392635165131)
filterVagrant.appendNode('name', '')
filterVagrant.appendNode('type', 30)
Node matcherVagrant = filterVagrant.appendNode('matcher')
matcherVagrant.appendNode('id', 'org.eclipse.ui.ide.multiFilter')
matcherVagrant.appendNode('arguments', '1.0-name-matches-false-false-.vagrant')
}
}
}
}
vagrant {
provider = 'virtualbox'
}
vagrantDestroy.doFirst {
if (!vagrantDir.isDirectory()) {
throw new StopExecutionException()
}
}
// Custom tasks
task changelog << {
def grgit = Grgit.open(project.file('.'))
def fileChangelog = new File('CHANGELOG.md')
def tags = ["HEAD"]
grgit.tag.list().reverse().each{ t ->
tags += t.getName()
}
fileChangelog.delete()
def builder
def commits;
def numTags = tags.size()
for (int i = 0; i < numTags; i++) {
builder = new StringBuilder()
builder.append("- Version ${tags[i]}:\n".replaceAll('Version HEAD', 'Upcoming version'))
if (tags[i+1] == null) {
commits = grgit.log(includes: [tags[i]])
} else {
commits = grgit.log { range tags[i+1], tags[i]; }
}
commits.inject(builder) { bldr, commit ->
bldr.append(' - ')
bldr.append(commit.shortMessage)
bldr.append('\n')
}
fileChangelog << builder.toString()
}
}
task vagrantExport(type: Zip) {
description = 'Builds an archive file that contains the files, needed to create the vagrant box'
from 'etc/vagrant'
appendix = ''
baseName = 'vagrantbox'
classifier = ''
version = getDate()
filter(FixCrLfFilter)
filter(ReplaceTokens, tokens: [db_username: 'myUser', db_password: 'myPassword'])
}
task vagrantPrepare << {
description = 'Prepares the vagrant environment (creates directory, copies Vagrantfile, ...)'
if (!vagrantDir.isDirectory()) {
println "Creating directory $vagrantDir and copying content"
vagrantDir.mkdirs()
sync {
from files('etc/vagrant')
into vagrantDir
filter(FixCrLfFilter)
filter(ReplaceTokens, tokens: [db_username: 'niko', db_password: 'secretPhdPassword#2014!'])
}
}
}
// task dependencies
tasks.vagrantUp.dependsOn vagrantPrepare
// Plugin declaration
plugins {
id 'com.bmuschko.vagrant' version '2.0'
id 'com.kageiit.url-cache' version '1.0.0'
id 'org.ajoberstar.grgit-release' version '0.10.0'
}
apply plugin: 'eclipse'
import org.ajoberstar.grgit.*
import org.apache.tools.ant.filters.FixCrLfFilter
import org.apache.tools.ant.filters.ReplaceTokens
// Basic settings
group = 'at.uibk.dbis'
version = '0.4.1-SNAPSHOT'
description = 'PhD project of Nikolaus Krismer (infrastructure as vagrantbox)'
ext {
vagrantDir = getProjectDir()
}
// Groovy method declaration
def getDate() {
def date = new Date()
def formattedDate = date.format('yyyyMMdd')
return formattedDate
}
// Detailled settings (dependencies, tasks, task configuration, ...)
eclipse {
project {
natures = [
'org.springsource.ide.eclipse.gradle.core.nature'
]
file {
withXml { xmlProvider ->
Node project = xmlProvider.asNode()
Node filteredResources = project.appendNode('filteredResources');
Node filterGit = filteredResources.appendNode('filter')
filterGit.appendNode('id', 1421146667415)
filterGit.appendNode('name', '')
filterGit.appendNode('type', 30)
Node matcherGit = filterGradle.appendNode('matcher')
matcherGit.appendNode('id', 'org.eclipse.ui.ide.multiFilter')
matcherGit.appendNode('arguments', '1.0-name-matches-false-false-.git')
Node filterGradle = filteredResources.appendNode('filter')
filterGradle.appendNode('id', 1392635165065)
filterGradle.appendNode('name', '')
filterGradle.appendNode('type', 30)
Node matcherGradle = filterGradle.appendNode('matcher')
matcherGradle.appendNode('id', 'org.eclipse.ui.ide.multiFilter')
matcherGradle.appendNode('arguments', '1.0-name-matches-false-false-.gradle')
Node filterVagrant = filteredResources.appendNode('filter')
filterVagrant.appendNode('id', 1392635165131)
filterVagrant.appendNode('name', '')
filterVagrant.appendNode('type', 30)
Node matcherVagrant = filterVagrant.appendNode('matcher')
matcherVagrant.appendNode('id', 'org.eclipse.ui.ide.multiFilter')
matcherVagrant.appendNode('arguments', '1.0-name-matches-false-false-.vagrant')
}
}
}
}
vagrant {
provider = 'virtualbox'
}
vagrantDestroy.doFirst {
if (!vagrantDir.isDirectory()) {
throw new StopExecutionException()
}
}
// Custom tasks
task changelog << {
def grgit = Grgit.open(project.file('.'))
def fileChangelog = new File('CHANGELOG.md')
def tags = ["HEAD"]
grgit.tag.list().reverse().each{ t ->
tags += t.getName()
}
fileChangelog.delete()
def builder
def commits;
def numTags = tags.size()
for (int i = 0; i < numTags; i++) {
builder = new StringBuilder()
builder.append("- Version ${tags[i]}:\n".replaceAll('Version HEAD', 'Upcoming version'))
if (tags[i+1] == null) {
commits = grgit.log(includes: [tags[i]])
} else {
commits = grgit.log { range tags[i+1], tags[i]; }
}
commits.inject(builder) { bldr, commit ->
bldr.append(' - ')
bldr.append(commit.shortMessage)
bldr.append('\n')
}
fileChangelog << builder.toString()
}
}
task vagrantExport(type: Zip) {
description = 'Builds an archive file that contains the files, needed to create the vagrant box'
from 'etc/vagrant'
appendix = ''
baseName = 'vagrantbox'
classifier = ''
version = getDate()
filter(FixCrLfFilter)
filter(ReplaceTokens, tokens: [db_username: 'myUser', db_password: 'myPassword'])
}
task vagrantPrepare << {
description = 'Prepares the vagrant environment (creates directory, copies Vagrantfile, ...)'
if (!vagrantDir.isDirectory()) {
println "Creating directory $vagrantDir and copying content"
vagrantDir.mkdirs()
sync {
from files('etc/vagrant')
into vagrantDir
filter(FixCrLfFilter)
filter(ReplaceTokens, tokens: [db_username: 'niko', db_password: 'secretPhdPassword#2014!'])
}
}
}
// task dependencies
tasks.vagrantUp.dependsOn vagrantPrepare
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment