Crafted a Gradle build for Android. Will separate build out later.

This commit is contained in:
Dorian 2013-04-02 19:19:15 -04:00
parent e5f5ec8d7e
commit cfad0c822c
52 changed files with 69 additions and 37 deletions

View File

@ -8,8 +8,22 @@
// TODO: Add the Android Gradle plugin: https://github.com/jvoegele/gradle-android-plugin/wiki // TODO: Add the Android Gradle plugin: https://github.com/jvoegele/gradle-android-plugin/wiki
// TODO: Add in support for multiple projects, to allow for clean separation of projects. // TODO: Add in support for multiple projects, to allow for clean separation of projects.
apply plugin: 'war' buildscript {
apply plugin: 'jetty' repositories {
maven {
url 'http://repo1.maven.org/maven2'
}
//mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.3'
}
}
apply plugin: 'android'
//apply plugin: 'war'
//apply plugin: 'jetty'
sourceCompatibility = 1.6 sourceCompatibility = 1.6
targetCompatibility = 1.6 targetCompatibility = 1.6
@ -18,6 +32,16 @@ targetCompatibility = 1.6
description = 'justCheckers' description = 'justCheckers'
version = '0.3' version = '0.3'
// Androids!!!
android {
//target = "android-14"
compileSdkVersion 14
/*defaultConfig {
versionCode = 12
minSdkVersion = 8
} */
}
project.ext { project.ext {
appName = 'justCheckers' appName = 'justCheckers'
appBaseName = "justcheckers" appBaseName = "justcheckers"
@ -28,15 +52,15 @@ project.ext {
} }
// Setup everything to work with the Eclipse friendly Web setup. // Setup everything to work with the Eclipse friendly Web setup.
sourceSets.main.java.srcDirs = ['src', 'gen'] //sourceSets.main.java.srcDirs = ['src', 'gen']
sourceSets.main.resources.srcDirs = ['res'] //sourceSets.main.resources.srcDirs = ['res']
//sourceSets.test.java.srcDirs = ['test-src'] //sourceSets.test.java.srcDirs = ['test-src']
// Setup build script repositories starting with Maven repositories // Setup build script repositories starting with Maven repositories
repositories { repositories {
flatDir { // flatDir {
dirs 'WebContent/WEB-INF/lib' // dirs 'WebContent/WEB-INF/lib'
} // }
maven { maven {
url 'http://repo1.maven.org/maven2' url 'http://repo1.maven.org/maven2'
} }
@ -45,8 +69,12 @@ repositories {
// Dependency management // Dependency management
dependencies { dependencies {
//compile 'org.jdom:jdom:1.1'
//compile 'jdom:jdom:0.9'
compile 'jdom:jdom:0.7'
// Spring Framework + SLF4J // Spring Framework + SLF4J
compile ('org.springframework:spring-context:' + project.springVersion) { /*compile ('org.springframework:spring-context:' + project.springVersion) {
exclude module: 'commons-logging' exclude module: 'commons-logging'
} }
compile 'log4j:log4j:1.2.16' compile 'log4j:log4j:1.2.16'
@ -58,26 +86,29 @@ dependencies {
compile 'org.springframework:spring-orm:' + project.springVersion compile 'org.springframework:spring-orm:' + project.springVersion
compile 'org.springframework:spring-webmvc:' + project.springVersion compile 'org.springframework:spring-webmvc:' + project.springVersion
compile 'org.springframework:spring-parent:' + project.springVersion compile 'org.springframework:spring-parent:' + project.springVersion
compile 'mysql:mysql-connector-java:5.1.22' */
//compile 'mysql:mysql-connector-java:5.1.22'
// xstream // xstream
compile 'com.thoughtworks.xstream:xstream:1.4.4' //compile 'com.thoughtworks.xstream:xstream:1.4.4'
// Hibernate + C3P0 // Hibernate + C3P0
/*
compile 'org.hibernate:hibernate:' + project.hibernateVersion compile 'org.hibernate:hibernate:' + project.hibernateVersion
compile 'org.hibernate:hibernate-annotations:' + project.hibernateVersion compile 'org.hibernate:hibernate-annotations:' + project.hibernateVersion
compile 'org.hibernate:hibernate-c3p0:' + project.hibernateVersion compile 'org.hibernate:hibernate-c3p0:' + project.hibernateVersion
compile 'javassist:javassist:3.9.0.GA' compile 'javassist:javassist:3.9.0.GA'
*/
// Apache Commons Libraries // Apache Commons Libraries
compile 'commons-httpclient:commons-httpclient:3.1' //compile 'commons-httpclient:commons-httpclient:3.1'
compile 'commons-lang:commons-lang:2.4' //compile 'commons-lang:commons-lang:2.4'
// FlexJson // FlexJson
compile 'net.sf.flexjson:flexjson:2.1' // compile 'net.sf.flexjson:flexjson:2.1'
// Javax Servlet and Mail APIs // Javax Servlet and Mail APIs
providedCompile 'javax.servlet:servlet-api:2.5' //providedCompile 'javax.servlet:servlet-api:2.5'
} }
// At the end of day we just need a JAR and a WAR. // At the end of day we just need a JAR and a WAR.
@ -98,15 +129,16 @@ ext.sharedManifest = manifest {
} }
// Build the JAR. // Build the JAR.
jar { //jar {
enabled = true // enabled = true
includeEmptyDirs = false // includeEmptyDirs = false
manifest = sharedManifest // manifest = sharedManifest
include '**/**.class' // include '**/**.class'
exclude 'build/**' // exclude 'build/**'
} //}
// Build WAR files that include the JAR file. Add the resources back in. // Build WAR files that include the JAR file. Add the resources back in.
/*
war { war {
from 'webapp' from 'webapp'
@ -126,9 +158,9 @@ jettyRun {
contextPath = project.appBaseName contextPath = project.appBaseName
webAppSourceDirectory = new File('webapp') webAppSourceDirectory = new File('webapp')
} }
*/
// Run embedded Jetty setup. // Run embedded Jetty setup.
jettyRunWar { /*jettyRunWar {
httpPort = 8080 httpPort = 8080
contextPath = project.appBaseName contextPath = project.appBaseName
} }*/

View File

@ -60,10 +60,10 @@ public class ConfigSettingsIO extends XML_IO{
ConfigSettingsIOReader csior = new ConfigSettingsIOReader(); ConfigSettingsIOReader csior = new ConfigSettingsIOReader();
csior.visit(rootElement); csior.visit(rootElement);
} }
catch(IOException e){ // catch(IOException e){
String msg = "Problem : " + e.getMessage(); // String msg = "Problem : " + e.getMessage();
Log.e("ConfigSettingsIO", msg); // Log.e("ConfigSettingsIO", msg);
} // }
catch(JDOMException e){ catch(JDOMException e){
String msg = "Problem : " + getFile().toString() String msg = "Problem : " + getFile().toString()
+ " is not a well formed XML document"; + " is not a well formed XML document";

View File

@ -62,10 +62,10 @@ public class GameSettingsIO extends XML_IO{
GameSettingsIOReader gsior = new GameSettingsIOReader(); GameSettingsIOReader gsior = new GameSettingsIOReader();
gsior.visit(rootElement); gsior.visit(rootElement);
} }
catch(IOException e){ //catch(IOException e){
String msg = "Problem : " + e.getMessage(); // String msg = "Problem : " + e.getMessage();
Log.e("GameSettingsIO", msg); // Log.e("GameSettingsIO", msg);
} //}
catch(JDOMException e){ catch(JDOMException e){
String msg = "Problem : " + getFile().toString() String msg = "Problem : " + getFile().toString()
+ " is not a well formed XML document"; + " is not a well formed XML document";

View File

@ -62,10 +62,10 @@ public class UserSettingsIO extends XML_IO{
UserSettingsIOReader usior = new UserSettingsIOReader(); UserSettingsIOReader usior = new UserSettingsIOReader();
usior.visit(rootElement); usior.visit(rootElement);
} }
catch(IOException e){ // catch(IOException e){
String msg = "Problem : " + e.getMessage(); // String msg = "Problem : " + e.getMessage();
Log.e("UserSettingsIO", msg); // Log.e("UserSettingsIO", msg);
} // }
catch(JDOMException e){ catch(JDOMException e){
String msg = "Problem : " + getFile().toString() String msg = "Problem : " + getFile().toString()
+ " is not a well formed XML document"; + " is not a well formed XML document";

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB