This project is a demo on how to transpile to Obj C from Xtend.
In a (tmux) terminal:
Prepare j2objc-gradle
- Install brew
- First, install java jdk 1.7:
brew tap caskroom/versions ; brew cask install caskroom/versions/java7
, otherwise you will get a café babe. Caveat: Do not run the install-osx-jdk7.sh script unless you want to lose all your JDKs. - Install jenv and add your jdk environments to jenv:
brew install jenv ; find /Library/Java/JavaVirtualMachines -name 'Home' -exec jenv add {} \;
- Build the
jenv shell 1.7 ; cd j2objc-gradle ; ./gradlew clean build
- Prepare the project itself, setup 'local.properties' for j2objc:
cd xtendAllPlatforms ; ./run-me-first
Prepare Xtendroid
- Be consistent and build with jdk 1.7:
jenv shell 1.7
- Determine the development branch on Xtendroid:
cd Xtendroid ; git branch --all
- Change to the development branch:
git checkout $(git branch --all | egrep -o "v[0-9]+\.[0-9]+_development")
- Be consistent and build with jdk 1.7:
jenv shell 1.7
- Import ':xtendshared' into your IDE (intellij / Android Studio), work from there as usual; ':xtendshared' has its own gradle rootProject, because ':xtendshared' requires gradle-2.10, and j2objc-gradle requires gradle-2.3.
- Run
gradle wrapper
to generate agradlew
file - Every time ':xtendshared' is built (
./gradlew build
), the java files will be copied to the ':shared' project, ':xtendapp' can also make ':xtendshared' start building - The same applies to
./gradlew cAT
, these will be transpiled to Objective C as well - Transpiling to j2objc, requires you run (
./gradlew build j2objcBuild
) in the directoryxtendAllPlatforms
- Create a task that determines the xtend code's package name, then obliterates ':shared' copy of the java files depending on that package name
- Write a wiki quote apps in XCode (swift) and Android Studio (>2.0.0 alpha) that uses the :shared project, just like the wikiquotes-api project.
- Eliminate dead code, with proguard and j2objc
- When j2obcj-gradle finally upgrades to >gradle-2.8, then we can merge the Xtendroid part
- Forget about URI.Builder, also forget UrlBuilder, roll your own
- Run unit tests with
xtendAllPlatforms> ./gradlew cleanTest test
and if you're confident./gradlew build
- Transpile from Xtend to java with
xtendshared> ./gradlew build cAT
, which triggers the copy actions HttpUrlConnection
is very broken when cast to ajava.net.ssl.HttpsUrlConnection
, IosHttpsUrlConnection seems to be promising, must do additional testing on j2objc-1.0.1.