Skip to content

Commit

Permalink
Removed unnecessary semicolons from the gradle script templates.
Browse files Browse the repository at this point in the history
  • Loading branch information
kelemen committed Nov 14, 2012
1 parent 38a8bd9 commit ff5efe9
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 47 deletions.
Expand Up @@ -2,23 +2,23 @@
// This file is to be applied to every subproject. // This file is to be applied to every subproject.
// //


apply plugin: 'java'; apply plugin: 'java'
apply plugin: 'maven'; apply plugin: 'maven'


String mavenGroupId = '${MAVEN_GROUP}'; String mavenGroupId = '${MAVEN_GROUP}'
String mavenVersion = '${MAVEN_VERSION}'; String mavenVersion = '${MAVEN_VERSION}'


sourceCompatibility = '${SOURCE_LEVEL}'; sourceCompatibility = '${SOURCE_LEVEL}'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'; [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'


String mavenArtifactId = name; String mavenArtifactId = name


group = mavenGroupId; group = mavenGroupId
version = mavenVersion; version = mavenVersion


task sourcesJar(type: Jar, dependsOn: classes, description: 'Creates a jar from the source files.') { task sourcesJar(type: Jar, dependsOn: classes, description: 'Creates a jar from the source files.') {
classifier = 'sources'; classifier = 'sources'
from sourceSets.main.allSource; from sourceSets.main.allSource
} }


artifacts { artifacts {
Expand All @@ -28,9 +28,9 @@ artifacts {


configure(install.repositories.mavenInstaller) { configure(install.repositories.mavenInstaller) {
pom.project { pom.project {
groupId = mavenGroupId; groupId = mavenGroupId
artifactId = mavenArtifactId; artifactId = mavenArtifactId
version = mavenVersion; version = mavenVersion
} }
} }


Expand All @@ -39,27 +39,27 @@ repositories {
} }


dependencies { dependencies {
testCompile group: 'junit', name: 'junit', version: '4.10'; testCompile group: 'junit', name: 'junit', version: '4.10'
} }


if (project.hasProperty('mainClass') && mainClass != '') { if (project.hasProperty('mainClass') && mainClass != '') {
task (run, dependsOn: classes, type: JavaExec) { task (run, dependsOn: classes, type: JavaExec) {
main = mainClass; main = mainClass
classpath = sourceSets.main.runtimeClasspath; classpath = sourceSets.main.runtimeClasspath
} }


task (debug, dependsOn: classes, type: JavaExec) { task (debug, dependsOn: classes, type: JavaExec) {
main = mainClass; main = mainClass
classpath = sourceSets.main.runtimeClasspath; classpath = sourceSets.main.runtimeClasspath
debug = true; debug = true
} }
} }


task createFolders(description: 'Creates the source folders if they do not exist.') doLast { task createFolders(description: 'Creates the source folders if they do not exist.') doLast {
sourceSets*.allSource*.srcDirs*.each { File srcDir -> sourceSets*.allSource*.srcDirs*.each { File srcDir ->
if (!srcDir.isDirectory()) { if (!srcDir.isDirectory()) {
println "Creating source folder: ${srcDir}"; println "Creating source folder: ${srcDir}"
srcDir.mkdirs(); srcDir.mkdirs()
} }
} }
} }
@@ -1,20 +1,20 @@
import org.gradle.api.artifacts.*; import org.gradle.api.artifacts.*


apply plugin: 'base'; // To add "clean" task to the root project. apply plugin: 'base' // To add "clean" task to the root project.


task mergedJavadoc(type: Javadoc, description: 'Creates Javadoc from all the projects.') { task mergedJavadoc(type: Javadoc, description: 'Creates Javadoc from all the projects.') {
title = 'All modules'; title = 'All modules'
destinationDir = new File(project.buildDir, 'merged-javadoc'); destinationDir = new File(project.buildDir, 'merged-javadoc')


// Note: The closures below are executed lazily. // Note: The closures below are executed lazily.
source { source {
subprojects*.sourceSets*.main*.allSource; subprojects*.sourceSets*.main*.allSource
} }
classpath.from { classpath.from {
subprojects*.configurations*.compile*.copyRecursive({ !(it instanceof ProjectDependency); })*.resolve(); subprojects*.configurations*.compile*.copyRecursive({ !(it instanceof ProjectDependency); })*.resolve()
} }
} }


task wrapper(type: Wrapper, description: 'Creates and deploys the Gradle wrapper to the current directory.') { task wrapper(type: Wrapper, description: 'Creates and deploys the Gradle wrapper to the current directory.') {
gradleVersion = '1.1'; gradleVersion = '1.1'
} }
@@ -1,18 +1,18 @@
rootProject.name = '${PROJECT_NAME}'; rootProject.name = '${PROJECT_NAME}'


// Find the directories containing a "build.gradle" file in the root directory // Find the directories containing a "build.gradle" file in the root directory
// of the project. That is, every directory containing a "build.gradle" will // of the project. That is, every directory containing a "build.gradle" will
// be automatically the subproject of this project. // be automatically the subproject of this project.
def subDirs = rootDir.listFiles(new FileFilter() { def subDirs = rootDir.listFiles(new FileFilter() {
public boolean accept(File file) { public boolean accept(File file) {
if (!file.isDirectory()) { if (!file.isDirectory()) {
return false; return false
} }


return new File(file, 'build.gradle').isFile(); return new File(file, 'build.gradle').isFile()
} }
}); });


subDirs.each { File dir -> subDirs.each { File dir ->
include dir.name; include dir.name
} }
@@ -1 +1 @@
rootProject.name = '${PROJECT_NAME}'; rootProject.name = '${PROJECT_NAME}'
@@ -1,28 +1,28 @@
apply plugin: 'java'; apply plugin: 'java'


sourceCompatibility = '${SOURCE_LEVEL}'; sourceCompatibility = '${SOURCE_LEVEL}'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'; [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'


String mainClass = '${MAIN_CLASS}'; String mainClass = '${MAIN_CLASS}'


task (run, dependsOn: classes, type: JavaExec) { task (run, dependsOn: classes, type: JavaExec) {
main = mainClass; main = mainClass
classpath = sourceSets.main.runtimeClasspath; classpath = sourceSets.main.runtimeClasspath
} }


task (debug, dependsOn: classes, type: JavaExec) { task (debug, dependsOn: classes, type: JavaExec) {
main = mainClass; main = mainClass
classpath = sourceSets.main.runtimeClasspath; classpath = sourceSets.main.runtimeClasspath
debug = true; debug = true
} }


repositories { repositories {
mavenCentral(); mavenCentral()
} }


dependencies { dependencies {
// TODO: Add dependencies here ... // TODO: Add dependencies here ...
// You can read more about how to add dependency here: // You can read more about how to add dependency here:
// http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:how_to_declare_your_dependencies // http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:how_to_declare_your_dependencies
testCompile group: 'junit', name: 'junit', version: '4.10'; testCompile group: 'junit', name: 'junit', version: '4.10'
} }
@@ -1,8 +1,8 @@
// Note that "mainClass" must be set before applying "parent.gradle" because // Note that "mainClass" must be set before applying "parent.gradle" because
// "parent.gradle" will define the "run" and "debug" task based on this value. // "parent.gradle" will define the "run" and "debug" task based on this value.
ext.mainClass = '${MAIN_CLASS}'; ext.mainClass = '${MAIN_CLASS}'


apply from: rootProject.file('parent.gradle'); apply from: rootProject.file('parent.gradle')


dependencies { dependencies {
// TODO: Add dependencies here // TODO: Add dependencies here
Expand Down

0 comments on commit ff5efe9

Please sign in to comment.