patrick-choe / mojang-spigot-remapper

Apache License 2.0
21 stars 3 forks source link

Multi Projects #5

Closed TheRedMagic closed 6 months ago

TheRedMagic commented 6 months ago

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* Where:
Build file 'C:\Users\lijnb\IdeaProjects\UndefinedAPI\v1_20_4\build.gradle.kts' line: 23

* What went wrong:
Expected task 'remap' output files to contain exactly one file, however, it contains no files.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
==============================================================================

2: Task failed with an exception.
-----------
* Where:
Build file 'C:\Users\lijnb\IdeaProjects\UndefinedAPI\v1_20_4\build.gradle.kts' line: 23

* What went wrong:
Expected task 'remap' output files to contain exactly one file, however, it contains no files.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
==============================================================================

CONFIGURE FAILED in 2s

This is the main build.gradle.kts

plugins {
    kotlin("jvm") version "1.9.22"
}

val versionVar = version
val groupIdVar = "com.redmagic"
val artifactIdVar = "UndefinedAPI"

repositories {
}

dependencies {
    compileOnly("org.spigotmc:spigot-api:1.20.4-R0.1-SNAPSHOT")

    implementation(project(":api"))
    implementation(project(":v1_20_4:", "remapped"))
}

tasks {

    compileKotlin {
        kotlinOptions.jvmTarget = "17"
    }

}
kotlin{
    jvmToolchain(17)
}

And this is the sub

plugins {
    kotlin("jvm") version "1.9.22"
    id("io.github.patrick.remapper") version "1.4.2"
}

val versionVar = version
val groupIdVar = "com.redmagic"
val artifactIdVar = "UndefinedAPI"

repositories {
}

dependencies {
    compileOnly("org.spigotmc:spigot:1.20.4-R0.1-SNAPSHOT:remapped-mojang")

    implementation(project(":api"))
}

configurations {
    create("remapped"){
        configurations.getByName("remapped").files().add(tasks.remap.get().outputs.files.singleFile)
    }
}

tasks {

    remap {
        version.set("1.20.4")
        archiveName.set("${project.name}-${versionVar}-remapped.jar")

    }

    compileKotlin {
        kotlinOptions.jvmTarget = "17"
    }

}
kotlin{
    jvmToolchain(17)
}
patrick-choe commented 6 months ago

remap task itself does not provide a file yet. you should probably access a file through hard-coded path. maybe I'll fix this in near future. sorry.