Skip to content

Commit

Permalink
create eclipse configuration with gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
hjanetzek committed Feb 24, 2014
1 parent ad62e26 commit ff83629
Show file tree
Hide file tree
Showing 23 changed files with 759 additions and 131 deletions.
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ build/
/vtm/libs/
/vtm-android-example/assets/
/vtm-gdx-desktop/assets/
/vtm-gdx-html/war/assets/
/vtm-gdx-html/war/WEB-INF/
/vtm-gdx-html/war/org.oscim.gdx.GwtDefinition/
/vtm-gdx-html/war/
/vtm-gdx-html/gwt-unitCache
/vtm-gdx-ios/
/vtm-spatialite/
Expand All @@ -28,8 +26,14 @@ build/
/tmp/
/themes/
/vtm/assets/themes/

.gradle
.idea
*.iml

.settings
.classpath
.project

local.properties

45 changes: 27 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,26 +1,35 @@
buildscript {
repositories {
mavenCentral()
mavenLocal()
}

dependencies {
classpath 'org.gradle.api.plugins:gradle-nexus-plugin:0.2'
classpath 'com.android.tools.build:gradle:0.7.+'

// https://github.com/dcendents/android-maven-plugin
classpath 'com.github.dcendents:android-maven-plugin:1.0'
}
repositories {
mavenCentral()
mavenLocal()
}

dependencies {
classpath 'org.gradle.api.plugins:gradle-nexus-plugin:0.2'
}
}

allprojects {
group = 'org.oscim'
version = '0.5.9-SNAPSHOT'
apply plugin: 'idea'

group = 'org.oscim'
version = '0.5.9-SNAPSHOT'

repositories {
mavenCentral()
mavenLocal()
}
repositories {
mavenCentral()
mavenLocal()
}
}

subprojects {
apply plugin: 'eclipse'

task copySettings(type: Copy) {
from "$rootDir/eclipse"
into ".settings"
include '**/*'
}

eclipseProject.dependsOn copySettings

}
291 changes: 291 additions & 0 deletions eclipse/org.eclipse.jdt.core.prefs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions eclipse/org.eclipse.jdt.ui.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
eclipse.preferences.version=1
formatter_profile=_eclipse-vtm
formatter_settings_version=12
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.9-all.zip
distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-all.zip
4 changes: 4 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
include ':vtm'
include ':vtm-extras'
include ':vtm-android'
include ':vtm-android-example'
include ':vtm-gdx'
include ':vtm-gdx-desktop'
include ':vtm-gdx-html'
include ':vtm-gdx-android'
include ':vtm-android-app'
109 changes: 85 additions & 24 deletions vtm-android-example/build.gradle
Original file line number Diff line number Diff line change
@@ -1,34 +1,95 @@
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.8.+'
}
}

apply plugin: 'android'

dependencies {
compile project(':vtm-android')
compile fileTree(dir: 'libs', include: '*.jar')
compile project(':vtm-android')
compile fileTree(dir: 'libs', include: '*.jar')
}

task copyAssets(type: Copy) {
from "$rootDir/vtm/assets"
into "assets"
include '**/*'
from "$rootDir/vtm/assets"
into "assets"
include '**/*'
}

tasks.withType(JavaCompile) { compileTask -> compileTask.dependsOn copyAssets }
tasks.withType(JavaCompile) { compileTask ->
compileTask.dependsOn copyAssets }

android {
compileSdkVersion 19
buildToolsVersion '19.0.1'

sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src', 'assets']
resources.srcDirs = ['src', 'assets']
aidl.srcDirs = ['src', 'assets']
renderscript.srcDirs = ['src', 'assets']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}

debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}
compileSdkVersion 19
buildToolsVersion '19.0.1'

sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src', 'assets']
resources.srcDirs = ['src', 'assets']
aidl.srcDirs = ['src', 'assets']
renderscript.srcDirs = ['src', 'assets']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}

debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}

// Including configurations into Eclipse
eclipse.classpath.plusConfigurations += configurations.compile

eclipse.jdt{
sourceCompatibility = 1.6
targetCompatibility = 1.6
}

// Configuring Eclipse classpath
eclipse.classpath {
//customizing the classes output directory:
defaultOutputDir = file('bin/classes')

file {

// Manipulation of the classpath XML before merging local
// and generated copies
beforeMerged { classpath ->
// Remove all source entries to avoid overlap
classpath.entries.removeAll() { c ->
c.kind == 'src'
}
}

// Direct manipulation of the generated classpath XML
withXml {
// Since non-default source directories are used
// they need to be manually added to the classpath XML
def node = it.asNode()

// Main source directory
node.appendNode('classpathentry kind="src" path="src"')
// Generated code directory
node.appendNode('classpathentry kind="src" path="gen"')
}
}
}

eclipse.project {
natures = ['com.android.ide.eclipse.adt.AndroidNature',
'org.eclipse.jdt.core.javanature']

buildCommand 'com.android.ide.eclipse.adt.ResourceManagerBuilder'
buildCommand 'com.android.ide.eclipse.adt.PreCompilerBuilder'
buildCommand 'com.android.ide.eclipse.adt.ApkBuilder'

linkedResource name: 'assets', type: '2',
locationUri: 'PARENT-1-PROJECT_LOC/vtm/assets'
}

109 changes: 88 additions & 21 deletions vtm-android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,29 +1,96 @@
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.8.+'

// for aar/maven stuff
// https://github.com/dcendents/android-maven-plugin
classpath 'com.github.dcendents:android-maven-plugin:1.0'
}
}

apply plugin: 'android-library'
apply plugin: 'android-maven'

dependencies {
compile fileTree(dir: "../vtm-ext-libs/vtm-android", include: 'native-libs-*.jar')
compile project(':vtm')
compile 'com.android.support:support-v4:19.0.1'
compile 'org.slf4j:slf4j-android:1.7.6'
compile project(':vtm')
compile files("${rootDir}/vtm-ext-libs/native-libs.jar")
compile 'com.android.support:support-v4:19.0.1'
compile 'org.slf4j:slf4j-android:1.7.6'
}

android {
compileSdkVersion 19
buildToolsVersion '19.0.1'

sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}

debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
compileSdkVersion 19
buildToolsVersion '19.0.1'
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}



// Including configurations into Eclipse
eclipse.classpath.plusConfigurations += configurations.compile

eclipse.jdt{
sourceCompatibility = 1.6
targetCompatibility = 1.6
}

eclipse.classpath {

//customizing the classes output directory:
defaultOutputDir = file('bin/classes')

file {
// Manipulation of the classpath XML before merging local
// and generated copies
beforeMerged { classpath ->
// Remove all source entries to avoid overlap
classpath.entries.removeAll() { c ->
c.kind == 'src'
}
}

// only used to explode jni .so into aar
whenMerged { classpath ->
classpath.entries.findAll { entry ->
entry.path.contains('native-libs') }*.exported = false
}

// Direct manipulation of the generated classpath XML
withXml {
// Since non-default source directories are used
// they need to be manually added to the classpath XML
def node = it.asNode()
// Main source directory and generated code directory
node.appendNode('classpathentry kind="src" path="src"')
node.appendNode('classpathentry kind="src" path="gen"')

}
}
}

eclipse.project {

natures = ['com.android.ide.eclipse.adt.AndroidNature',
'org.eclipse.jdt.core.javanature']
buildCommand 'com.android.ide.eclipse.adt.ResourceManagerBuilder'
buildCommand 'com.android.ide.eclipse.adt.PreCompilerBuilder'
buildCommand 'com.android.ide.eclipse.adt.ApkBuilder'

// use extracted jni .so in eclipse
linkedResource name: 'libs', type: '2',
locationUri: 'PARENT-1-PROJECT_LOC/vtm-ext-libs/vtm-android'
}

16 changes: 16 additions & 0 deletions vtm-extras/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apply plugin: 'java'
apply plugin: 'maven'

sourceSets {
main.java.srcDirs = ['src']
main.resources.srcDirs = ['src']
}

dependencies {
compile project(':vtm')
compile 'com.google.protobuf:protobuf-java:2.4.1'
compile 'org.openstreetmap.osmosis:osmosis-osm-binary:0.43.1'
compile 'com.fasterxml.jackson.core:jackson-core:2.3.0'
compile 'com.vividsolutions:jts:1.13'
}

Loading

0 comments on commit ff83629

Please sign in to comment.