Home Features Docs Blog Support GitHub

MOE-Library dependencies


(Christian Ringshofer) #1

Hey there!

Is it possible to create a library project which does use apple.* classes?
In my case gradle will not find the moe-sdk when declaring it in the dependencies closure.

When applying the gradle plugin the plugin wants me to have a real xcode project inside the folder.

I wanted to provide a cross-platform library which can be helpful to speed up development and ui handling on android and ios!

Thanks!


(Roland Vigh - Migeran) #2

Hi!

Please use apply plugin: ‘moe-sdk’, if create library project without xcode. All apple.* class available.

Best Regards,
Roland


(Christian Ringshofer) #3

awesome! You’re my todays hero, saved me a lot of further investigation :slight_smile:


(Christian Ringshofer) #4

Sorry, to write you again. I’ve still got a problem here. Building the project and using apple.* classes worked quite fine, but I think I might have a wrong configuration.

Currently I want to add the soures of the library-module to my ios-module.

I’ve got these module dependencies:

:moelib (pure java)
:moelib-ios (moe-sdk) -> :moelib

:app-core (my pure java core project)
:app-ios (moe) -> :moelib-ios, :app-core

the build.gradle of my lib modules look like the following:

moelib (build.gradle):

apply plugin: 'idea'
apply plugin: 'java'

sourceCompatibility = '1.8'
targetCompatibility = '1.8'

dependencies {
    compile 'org.jetbrains:annotations:15.0'
    compileOnly 'org.projectlombok:lombok:1.18.0'
}

moelib-ios (build.gradle):

buildscript {
    repositories {
        mavenCentral()
        maven { url 'https://plugins.gradle.org/m2/' }
    }
    dependencies {
        classpath group: 'org.multi-os-engine', name: 'moe-gradle', version: '1.4.4'
    }
}

apply plugin: 'moe-sdk'

// Set source and target to Java 8
targetCompatibility = '1.8'
sourceCompatibility = '1.8'

repositories {
    mavenCentral()
}

dependencies {
    compile project(':moelib')
    compileOnly 'org.projectlombok:lombok:1.18.0'
}

The app-ios module does compile the moelib-ios module.

But at the moment I facing the problem, when I want to run the app-ios module the compiler will throw an error quite fast with the error:

unknown enum constant ElementType.TYPE_USE

I’m pretty sure I’ve set the compile and target version to 1.8. How can I fix the issue? :frowning:


(Roland Vigh - Migeran) #5

Hi!

Please check this class in “External Libraries -> moe-core -> java”, only these java classes supported.

Best Regards,
Roland


(Christian Ringshofer) #6

Oh I see! So could it be that I’m not able to use classes like SEL, since it’s in the moe-ios, but not in the moe-core lib? :slight_smile:

EDIT: I’ve now double-checked all classes and now there is no class or library besides used which is not contained in the core. It still does not work…

When building with --scan gradle will show me following reason for failing:
com.sun.tools.javac.code.Symbol$CompletionFailure: class file for java.lang.invoke.MethodType not found

Might it be that I’m missing retrolambda here or something? Am I even able to use 1.8 features in the lib module?