Skip to content

Commit

Permalink
Merge pull request #115 from tobykurien/v0.13_development
Browse files Browse the repository at this point in the history
V0.13 development
  • Loading branch information
tobykurien committed Mar 23, 2016
2 parents 2631cc8 + 350d004 commit 21ee71a
Show file tree
Hide file tree
Showing 246 changed files with 2,479 additions and 341 deletions.
6 changes: 6 additions & 0 deletions .gitignore
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ local.properties
.gradle
build
gradle.properties

# IDEA
./out
.DS_Store
.idea
*.iml
Empty file modified LICENSE
100755 → 100644
Empty file.
36 changes: 22 additions & 14 deletions README.md
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -211,20 +211,20 @@ Note that the Active Annotations run at edit-time and simply generate the usual
Getting Started
===============

Have a look at the [XtendApp skeleton app][xtendapp] to jump-start your project. It is pre-configured and works in Android Studio as well (although support for Xtend in Android Studio is still in development).
Have a look at the [XtendApp skeleton app][xtendapp] to jump-start your project. It is a pre-configured skeleton Xtendroid app for Android Studio 2+. Simply clone it to begin your new project.

Method 1: Copy JAR file in
------------------------
- Download the latest release from https://github.com/tobykurien/Xtendroid/tree/master/Xtendroid/release
- Copy the JAR file into your Android project's `libs` folder
- If your project isn't Xtend-enabled yet:
- If your project isn't Xtend-enabled yet in Eclipse:
- Right-click on your project -> Properties -> Java Build Path
- Click Libraries -> Add library -> Xtend Library
- Now you can use it as documented [here][doc].

Method 2: Gradle build config
---------------------------
- In your `build.gradle` file, add a compile dependency for ```com.github.tobykurien:xtendroid:0.12.0``` and also add the [Xtend compiler](https://github.com/oehme/xtend-gradle-plugin)
- In your `build.gradle` file, add a compile dependency for ```com.github.tobykurien:xtendroid:0.13``` and also add the [Xtend compiler](http://xtext.github.io/xtext-gradle-plugin/xtend.html)
- A typical `build.gradle` file looks as follows:

```groovy
Expand All @@ -235,23 +235,23 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'org.xtend:xtend-android-gradle-plugin:0.4.8'
classpath 'com.android.tools.build:gradle:2.1.0-alpha3'
classpath 'org.xtext:xtext-android-gradle-plugin:1.0.3'
}
}
apply plugin: 'android'
apply plugin: 'org.xtend.xtend-android'
apply plugin: 'org.xtext.android.xtend'
repositories {
mavenCentral()
}
android {
dependencies {
compile 'com.github.tobykurien:xtendroid:0.12.1'
compile 'com.github.tobykurien:xtendroid:0.13'
compile 'org.eclipse.xtext:org.eclipse.xtext.xbase.lib:2.8.3'
compile 'org.eclipse.xtend:org.eclipse.xtend.lib:2.9.1'
// other dependencies here
}
Expand All @@ -263,24 +263,32 @@ android {
Xtend
=====

The latest version of Xtendroid is built with Xtend v2.8.1. For more about the Xtend language, see [http://xtend-lang.org][xtend].
The latest version of Xtendroid is built with Xtend v2.9.1. For more about the Xtend language, see [http://xtend-lang.org][xtend].

A port of Xtendroid to [Groovy][] is in the works, see [android-groovy-support][]

Gotchas
=======
IDE Support
===========

Note that Xtend and Xtendroid are currently supported in Eclipse (Xtend is an Eclipse project), although projects using them can be compiled with Maven or Gradle. You can [use Xtendroid in Android Studio][android_studio], but the Android Studio Xtend editor is currently still under development. For Android Studio, an alternative is to use the [android-groovy-support] project.
Xtend and Xtendroid are currently supported in Eclipse (Xtend is an Eclipse project) as well as Android Studio 2+ (or IntelliJ 15+). Here's how to [use Xtendroid in Android Studio][android_studio]. Also for Android Studio, check out the [android-groovy-support] project for a similar library for the Groovy language.

If you'd like to use Gradle for your build configuration, but still be able to develop in Eclipse, use the [Eclipse AAR plugin for Gradle][eclipse_aar_gradle]. This also allows you to use either Eclipse or Android Studio while maintaining a single build configuration.

Gotchas
=======

There are currently some bugs with the Eclipse Xtend editor that can lead to unexpected behaviour (e.g. compile errors).
Here are the current bugs you should know about:

- [Android: Editor not refreshing R class](https://bugs.eclipse.org/bugs/show_bug.cgi?id=433358)
- [Android: First-opened Xtend editor shows many errors and never clears those errors after build ](https://bugs.eclipse.org/bugs/show_bug.cgi?id=433589)

If in doubt, clean the project, and re-open the editor.
If in doubt, close and re-open the file, or worst-case, clean the project.

Some Xtend Gradle plugin gotchas:

- [First Gradle build fails, but works thereafter](https://github.com/xtext/xtend-gradle-plugin/issues/32)


[Xtend]: http://xtend-lang.org
[xtend-doc]: http://www.eclipse.org/xtend/documentation.html
Expand All @@ -291,7 +299,7 @@ If in doubt, clean the project, and re-open the editor.
[examples]: /examples
[Xtendroid Test app]: /XtendroidTest
[xtendapp]: https://github.com/tobykurien/XtendApp
[android_studio]: https://github.com/tobykurien/Xtendroid/issues/62
[android_studio]: https://github.com/tobykurien/Xtendroid/wiki/HowTo-setup-Android-Studio-%28aka-Intellij%29-support
[eclipse_aar_gradle]: https://github.com/ksoichiro/gradle-eclipse-aar-plugin
[Groovy]: http://groovy-lang.org
[android-groovy-support]: https://github.com/tobykurien/android-groovy-support
9 changes: 5 additions & 4 deletions Xtendroid/.classpath
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="con" path="org.eclipse.xtend.XTEND_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.andmore.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="org.eclipse.andmore.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="org.eclipse.andmore.DEPENDENCIES"/>
<classpathentry exported="true" kind="con" path="org.eclipse.xtend.XTEND_CONTAINER"/>
<classpathentry kind="lib" path="libs-compile/gson-2.6.2.jar"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
Empty file modified Xtendroid/.gitignore
100755 → 100644
Empty file.
8 changes: 4 additions & 4 deletions Xtendroid/.project
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<name>org.eclipse.andmore.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<name>org.eclipse.andmore.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
Expand All @@ -26,13 +26,13 @@
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<name>org.eclipse.andmore.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.andmore.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
</natures>
Expand Down
Empty file modified Xtendroid/.settings/org.eclipse.core.resources.prefs
100755 → 100644
Empty file.
12 changes: 12 additions & 0 deletions Xtendroid/.settings/org.eclipse.jdt.core.prefs
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
org.eclipse.jdt.core.builder.duplicateResourceTask=warning
org.eclipse.jdt.core.builder.invalidClasspath=abort
org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=enabled
org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*._trace,*.xtend,*.xtendbin
org.eclipse.jdt.core.circularClasspath=error
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
Expand All @@ -7,6 +16,9 @@ org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.incompatibleJDKLevel=ignore
org.eclipse.jdt.core.incompleteClasspath=error
Empty file modified Xtendroid/.settings/org.eclipse.xtend.core.Xtend.prefs
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion Xtendroid/AndroidManifest.xml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="17" />
android:targetSdkVersion="23" />

<application>
</application>
Expand Down
86 changes: 56 additions & 30 deletions Xtendroid/build.gradle
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,38 +1,64 @@
apply plugin: 'android-library'
apply plugin: "org.xtend.xtend-android"
buildscript {scriptHandler->
apply from: '../repositories.gradle', to: scriptHandler
apply from: '../dependencies.gradle'
dependencies {
classpath(project.ext.build.android_gradle)
classpath(project.ext.build.xtend_android_gradle)
}
}

repositories {
jcenter()
}

apply plugin: 'com.android.library'
apply plugin: "org.xtext.android.xtend"
apply from: '../dependencies.gradle'
apply from: './maven-push.gradle'

dependencies {
compile 'com.android.support:support-v4:20.0.0'
compile 'org.eclipse.xtend:org.eclipse.xtend.lib:2.7.3'
xtendCompileOnly 'com.github.oehme.xtend:xtend-contrib:0.4.+'
compile 'com.google.code.gson:gson:2.3.1' // required by @AndroidJsonizer
compile(project.ext.lib.android.support_v4)
compile(project.ext.lib.android.appcompat_v7)
compile(project.ext.lib.xtend)
}

android {
compileSdkVersion 19
buildToolsVersion "21.1.1"
sourceSets {
main {
manifest {
srcFile 'AndroidManifest.xml'
}
java {
srcDir 'src'
}
res {
srcDir 'res'
}
assets {
srcDir 'assets'
}
resources {
srcDir 'src'
}
aidl {
srcDir 'src'
}
compileSdkVersion(project.ext.compileSdkVersion)
buildToolsVersion(project.ext.buildToolsVersion)

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

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

lintOptions {
abortOnError false
}

packagingOptions {
// from xtendlib >=2.9.2
exclude 'META-INF/ECLIPSE_.RSA'
exclude 'META-INF/ECLIPSE_.SF'
}
}

apply from: 'maven-push.gradle'

Empty file modified Xtendroid/docs/coming_soon.md
100755 → 100644
Empty file.
Loading

0 comments on commit 21ee71a

Please sign in to comment.