[SOLVED] Gradle.build flatDir fileTree github workflow

Anyone else tried using a flatDir or fileTree for dependencies in a github gradle workflow and get build fails for not locating the jars, even though the error log path points right to the jars?

i.e the error says its searching for the exact file, in the exact place it should be, the jars are there, the workflow just ignores them?

We probably need to see stuff. Sometimes paths can look like they match but be off… or have versions when they shouldn’t or whatever.

…wait, what do you mean by “github gradle workflow”?

I use fileTree for local dependencies all the time but I don’t know how that relates to a “github workflow”.

Github action workflow, like used in the engine to build distributions.

flatDir and fileTree work fine on local builds, just that when running same for the github workflow it just wont recognize the files.

I reported it to gradle and github.

It has details on exactly whats going on.

I suspect that github is silently blocking the loading of depends from fileTree and flatDirs.

Driving me nuts. 2 days and counting. 24hrs or more on this one error. Read every search thread possible, nothing, gradle docs, github docs, nothing, bug reports, nothing.

Not sure this will help but showing list and log error are same dirs and jars are there.

Run ls -al /home/runner/work/game-client/game-client/sync/network
total 28
drwxr-xr-x 2 runner docker 4096 Aug 27 04:45 .
drwxr-xr-x 4 runner docker 4096 Aug 27 04:45 ..
-rw-r--r-- 1 runner docker 5392 Aug 27 04:45 common-game-0.4.0.jar
-rw-r--r-- 1 runner docker 2355 Aug 27 04:45 common-host-0.3.0.jar
-rw-r--r-- 1 runner docker 7003 Aug 27 04:45 util-java-0.3.0.jar

* What went wrong:
> Task :compileJava FAILED
Execution failed for task ':compileJava'.
:compileJava (Thread[Daemon worker,5,main]) completed. Took 4.789 secs.
> Could not resolve all files for configuration ':compileClasspath'.
   > Could not find :common-game:0.4.0.
     Searched in the following locations:
       - file:/home/runner/work/game-client/game-client/sync/network/common-game-0.4.0.jar
       - file:/home/runner/work/game-client/game-client/sync/network/common-game.jar
     Required by:
         project :
   > Could not find :common-host:0.3.0.
     Searched in the following locations:
       - file:/home/runner/work/game-client/game-client/sync/network/common-host-0.3.0.jar
       - file:/home/runner/work/game-client/game-client/sync/network/common-host.jar
     Required by:
         project :
   > Could not find :util-java:0.3.0.
     Searched in the following locations:
       - file:/home/runner/work/game-client/game-client/sync/network/util-java-0.3.0.jar
       - file:/home/runner/work/game-client/game-client/sync/network/util-java.jar
     Required by:
         project :

build.gradle

    repositories {  
        //Common network files dir
        flatDir {
            dirs "$rootProject.projectDir/sync/network"
        }
...

dependencies {

...

    //Common networking jars
    implementation ":common-game:0.4.0"
    implementation ":common-host:0.3.0"
    implementation ":util-java:0.3.0"    
//    implementation fileTree(dir: 'sync/network', include: ['*.jar'])

Wonder if its hanging because of no group?

Edit: Removed test of hard coded folders for flatDirs. Now folders and erros match for list.

I figured it out…

If you use project.sync locally, and push to github workflow, sync cant find the repo folders it was syncing with locally.

Sync will still delete the contents of the folders you were moving files into though.

As I was syncing an SDK assets folder, my networking jars, and the updater, all got deleted. So depends failed.

Now I will have to move things into a task instead, make sure the folders exists and call the task if they do.