考虑下面的build.gradle:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'org.javafxports:jfxmobile-plugin:1.0.0-b9'
    }
}

apply plugin: 'org.javafxports.jfxmobile'

repositories {
    jcenter()
}

mainClassName = 'com.rameses.Main'

jfxmobile {
    android {
        manifest = 'src/android/AndroidManifest.xml'
    }
    ios {
        infoPList = file('src/ios/Default-Info.plist')
    }
}

我想添加一个新的依赖项
 dependencies {
     compile files('libs/custom.jar')
 }

问题:如何将两个依赖项合并在一起?我尝试了类似下面的代码的方法,但是没有成功,它引发了错误。任何的想法?
dependencies {
    classpath 'org.javafxports:jfxmobile-plugin:1.0.0-b9',
    compile files('libs/custom.jar')
}

最佳答案

像这样将单独的依赖项块添加到构建gradle-

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'org.javafxports:jfxmobile-plugin:1.0.0-b9'
    }
}

apply plugin: 'org.javafxports.jfxmobile'

repositories {
    jcenter()
}

mainClassName = 'com.rameses.Main'

jfxmobile {
    android {
        manifest = 'src/android/AndroidManifest.xml'
    }
    ios {
        infoPList = file('src/ios/Default-Info.plist')
    }
}
dependencies {
compile files('libs/custom.jar')
//other dependencies - go here
}

10-07 23:43