我有以下结构:
文件夹“MyProject”
------ Root Project 'MyProject_gradle'
------ Subproject 'MyProject_library'
------ Subproject 'MyProject_game'
------ Sub Root Project 'jme3'
------ ------ Subproject 'jme3-core'
------ ------ Subproject 'jme3-lwjgl3'
根项目正确地包含两个子项目。然而,当我包含子根项目“jme3”时,它将作为普通子项目包含。换言之,子项目不会加载,因为设置。未加载jme3子根项目中的gradle。
我想要的是:包括“jme3”还应该包括它的子项目,并将其设置仅应用于它的子项目。
MyProject_gradle/build.gradle
:
allprojects {
project.ext {
retroFlashyRPG = [
basicName : 'RetroFlashyRPG_',
prototypeName : 'RetroFlashyRPG_Prototype_'
]
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'idea'
group = 'com.chevreuilgames'
sourceCompatibility = 1.9
targetCompatibility = 1.9
repositories {
mavenCentral()
jcenter()
maven {
url "https://dl.bintray.com/stephengold/org.jmonkeyengine/"
}
}
project.ext {
jme = [
group : 'org.jmonkeyengine',
version : '3.1.0-stable'
]
}
}
MyProject_gradle/settings.gradle
:
def RetroFlashyRPG = "RetroFlashyRPG_" // This is MyProject in this post's example
def RetroFlashyRPG_Prototype = RetroFlashyRPG + "Prototype_"
include 'prototype-library'
include 'jme3'
project(":prototype-library").projectDir = new File(settingsDir, "../${RetroFlashyRPG_Prototype}Library")
project(":jme3").projectDir = new File(settingsDir, "../${RetroFlashyRPG_Prototype}jmonkeyengine")
MyProject_jme3/settings.gradle
:
/**
* This is the global settings file used by all subprojects.
**/
rootProject.name = 'jmonkeyengine'
// Core classes, should work on all java platforms
include 'jme3-core'
include 'jme3-effects'
include 'jme3-networking'
include 'jme3-plugins'
include 'jme3-terrain'
// Desktop dependent java classes
include 'jme3-desktop'
include 'jme3-blender'
include 'jme3-jogl'
include 'jme3-lwjgl'
include 'jme3-lwjgl3'
// Other external dependencies
include 'jme3-jbullet'
include 'jme3-niftygui'
include 'jme3-jogg'
include 'jme3-android'
include 'jme3-ios'
//native builds
include 'jme3-bullet' //java
include 'jme3-bullet-native' //cpp
include 'jme3-bullet-native-android' //cpp
include 'jme3-android-native' //cpp
// Test Data project
include 'jme3-testdata'
// Example projects
include 'jme3-examples'
if(buildAndroidExamples == "true"){
include 'jme3-android-examples'
}