gpt4 book ai didi

gradle - Gradle无法找到项目(找不到路径为$的项目)

转载 作者:行者123 更新时间:2023-12-03 05:56:03 25 4
gpt4 key购买 nike

该项目(示例)取决于父目录中定义的项目。它根本不是父目录项目构建的一部分。但是,Gradle从未在我的任何文件夹中找到包含项目的项目。父目录包含libGDX的多平台多项目库项目。我到目前为止无法调用project()在任何目录中找到一个...

FAILURE: Build failed with an exception.

* Where:
Settings file '/home/athenacadence/git/gdx-complextext/example/settings.gradle' line: 2

* What went wrong:
A problem occurred evaluating settings 'example'.
> Project with path '/../html' could not be found.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

CONFIGURE FAILED

Total time: 0.124 secs

gdx-complextext / example / settings.gradle
include 'desktop', 'android', 'ios', 'html', 'core', 'ios-moe'
includeBuild(project("/../html"))

gdx-complextext / build.gradle
ext {
GROUPID = 'com.athenaeumapps.gdxcomplextext'
VERSION = '0.0.1-SNAPSHOT'

}

buildscript {
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
jcenter()
maven { url uri(System.getenv("INTEL_MULTI_OS_ENGINE_HOME") + "/gradle") }
}
dependencies {
classpath 'com.goharsha:gwt-opentype:0.1-SNAPSHOT'
classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6'
classpath 'com.android.tools.build:gradle:2.1.3'
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.2.0'
classpath group: 'org.multi-os-engine', name: 'moe-gradle', version: '1.1.+'
}
}

allprojects {
apply plugin: "eclipse"

ext {
appName = 'gdx-complextext'
gdxVersion = '1.9.6'
roboVMVersion = '2.2.0'
}

repositories {
mavenCentral()
mavenLocal()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
}

group = GROUPID
version = VERSION
}

project(":android") {
configurations {
custom
compile.extendsFrom custom
}

eclipse {
project {
name = appName + "-android"
}
}

dependencies {
compile project(':core')
compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"

}
}


project(":core") {
apply plugin: 'java'

apply from: '../publish.gradle'

configurations {
custom
compile.extendsFrom custom
}

eclipse {
project {
name = appName + "-core"
}
}

dependencies {
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
}
}




project(":desktop") {
apply plugin: 'java'

apply from: '../publish.gradle'

configurations {
custom
compile.extendsFrom custom
}

eclipse {
project {
name = appName + "-desktop"
}
}

dependencies {
compile project(':core')
}
}


project(":html") {
apply plugin: 'java'


apply from: '../publish.gradle'

configurations {
custom
compile.extendsFrom custom
}

eclipse {
project {
name = appName + "-html"
}
}

dependencies {
compile project(':core')
}
dependencies {
compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion"
compile "com.badlogicgames.gdx:gdx:$gdxVersion:sources"
compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion:sources"
}
}



project(":ios") {
apply plugin: 'java'
apply plugin: 'robovm'

apply from: '../publish.gradle'

configurations {
custom
compile.extendsFrom custom
}

eclipse {
project {
name = appName + "-ios"
}
}

dependencies {

compile project(':core')

compile "com.mobidevelop.robovm:robovm-rt:${roboVMVersion}"
compile "com.mobidevelop.robovm:robovm-cocoatouch:${roboVMVersion}"
compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"

}
}


project(":ios-moe") {
apply plugin: 'java'
apply plugin: 'moe'


apply from: '../publish.gradle'

configurations {
custom
compile.extendsFrom custom
natives
}

eclipse {
project {
name = appName + "-ios-moe"
}
}

dependencies {

compile project(':core')

compile "com.badlogicgames.gdx:gdx-backend-moe:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
}
}

编辑

尝试了includeBuild之后,我得到了:

includeBuild(“$ {rootProject.projectDir} /../ html”)

最佳答案

请尝试使用另一种方法来使用rootProject.projectDir获取项目位置,然后添加../html,根据documentation的介绍,也无需将其包装到project中。仅使用includeBuild,如下所示:

includeBuild("${rootProject.projectDir}/../html")

可以找到另一个示例 here

关于gradle - Gradle无法找到项目(找不到路径为$的项目),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44856165/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com