'libDist' Script Failure for jME

Hi everyone,
I’ve recently cloned the master branch of the jMonkeyEngine project with the SDK, and successfully built the 3.8.0-SNAPSHOT version using Gradle. However, I’m encountering issues when attempting to run the libDist script.

I’m wondering if others are experiencing similar problems on Windows.

Error message:

* Where:
Script 'C:\jme-workspace\jmonkeyengine\build.gradle' line: 91

* What went wrong:
Execution failed for task ':libDist'.
> Could not copy file 'C:\jme-workspace\jmonkeyengine\jme3-android\build\libs\jme3-android-3.8.0-SNAPSHOT.jar' to 'C:\jme-workspace\jmonkeyengine\build\libDist\lib\jme3-android.task ':jme3-android:jar' property 'archiveExtension''.
   > C:\jme-workspace\jmonkeyengine\build\libDist\lib\jme3-android.task ':jme3-android:jar' property 'archiveExtension' (The filename, directory name, or volume label syntax is incorrect)

from build.gradle:

task libDist(dependsOn: subprojects.build, description: 'Builds and copies the engine binaries, sources and javadoc to build/libDist') {
    doLast {
        File libFolder = mkdir("$buildDir/libDist/lib")
        File sourceFolder = mkdir("$buildDir/libDist/sources")
        File javadocFolder = mkdir("$buildDir/libDist/javadoc")
        subprojects.each {project ->
            if(!project.hasProperty('mainClassName')){
                project.tasks.withType(Jar).each {archiveTask ->
                    if(archiveTask.archiveClassifier == "sources"){
                        copy {
                            from archiveTask.archivePath
                                into sourceFolder
                                rename {project.name + '-' + archiveTask.archiveClassifier +'.'+ archiveTask.archiveExtension}
                        }
                    } else if(archiveTask.archiveClassifier == "javadoc"){
                        copy {
                            from archiveTask.archivePath
                                into javadocFolder
                                rename {project.name + '-' + archiveTask.archiveClassifier +'.'+ archiveTask.archiveExtension}
                        }
                    } else{
                        copy {
                            from archiveTask.archivePath
                                into libFolder
                                rename {project.name + '.' + archiveTask.archiveExtension}
                        }
                    }
                }
            }
        }
    }
}

Edit:
Could this be the cause of the problem? Is there an error in the build.gradle file?

Check the Filename:

  • The destination filename seems to be missing an extension. The error message suggests that the archiveExtension property might not be set correctly.
  • You might need to adjust the task configuration to include the .jar extension in the destination filename.

Edit:
can anyone tell me if there is a bug in the ‘libDist’ task of the jme engine build.gradle file?

1 Like

I failed to reproduce this issue in NetBeans. Discuss at issue 2335.

2 Likes