通过我的intellij中的build.gradle文件创建的flex应用程序模块是一个Java模块,而不是flash模块。
class CardsRepository @Inject constructor(
private val cardsDao: CardsDao,
private val apiManager: ApiManager
){
fun getUserCards(onSuccess: (List<Card>)->Unit, onError: (Exception)->Unit) =
cardsDao.loadAll()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
{ composeCardInfo(
it.filterNot {
it.cardState == CardState.Blocked ||
it.cardState == CardState.Deleted
},
onSuccess, onError) },
{onError(Exception(it.message))}
)
这是一个多项目gradle应用程序
//Define buildscript properties
buildscript {
//Use the primary maven repo
repositories {
mavenCentral()
}
//We need the gradlefx plugin to run
dependencies {
classpath group: 'org.gradlefx', name: 'gradlefx', version: '1.4.0'
}
}
apply plugin: 'gradlefx'
flexHome = System.getenv('FLEX_HOME')
type = 'swf'
srcDirs = ['./', '../web_stuff']
resourceDirs = ['/resources']
mainClass = 'Web'
output = 'Web'
playerVersion = '11.1'
//Compile using the config file, this file will be dynamically modified to easily switch between variants
additionalCompilerOptions = ['-load-config=' + """pwd""".execute().text.trim() + '/buildSrc/flex-config.xml', '-target-player=11.1']
//Define our HTML wrapper
htmlWrapper {
source = '../html-template/index.template.html'
title = "1.28.00"
application = "${project.mainClass}"
swf = "${project.mainClass}"
file = "${project.mainClass}" + ".html"
}
}
compileFlex.dependsOn createHtmlWrapper
//Use the primary maven repo
repositories {
mavenCentral()
}
//We need these libs to compile
dependencies {
//Our included swc files
internal fileTree(dir: '../flex_libs', include: '*.swc')
//Use the tomcat rsls that will be referenced at runtime
merged fileTree(dir: System.getenv('FLEX_HOME') + '/frameworks/rsls', include: '*.swf')
flexSDK files('../../../ApacheFlexSDK.zip')
}
flexApp build.gradle中的compileFlex从javaApp build.gradle中调用。创建的Java模块很好,没有问题。