This message was deleted.
# community-support
s
This message was deleted.
c
it’s been a few decades since I’ve seen
A:
drive in use, hopefully that’s not a floppy disk…
j
No, it's NAS :D since I'm a full stack dev. so I have everything on the cloud no :D. but honestly Amused :D
what is quite strange is that cleanOlds() works perfectly.
Copy code
task cleanOld() {
    [
            'A:/workspaces/latest/plugins/',
            'A:/plugins/'
    ]
    .each {destination -> {
        def tree = fileTree(destination)
        tree.include('**/skJson*.jar')
        tree.each {it.delete()}
    }}
}
c
a few cleanup items to simplify that task: • dependsOn is not required; as you are copying from the
jar
task that will create the correct dependencies; • try/catch is not necessary; all you are doing here is configuration (not execution) • It isn’t clear what the type of the task is - should either be a
Copy
task, or use
copy { }
within a doFirst of a generic task.
j
working with gradle for the first time can you please write me a literal example? using my template?
Copy code
task release(type: Copy) {
    dependsOn(shadowJar)
    [
            'A:\\workspaces\\plugins'
    ]
    .each {destination -> copy
            {
                from shadowJar
                into destination
            }
    }
}
c
Here’s one what that isn’t totally ideal, next iteration coming shortly.
Copy code
task release {
    dependsOn(shadowJar, build)  
    doFirst {
	    [
	            'A:/workspaces/plugins'
	    ]
	    .each {destination -> copy {
	            from jar
	            into destination
	    }
   }
}
This is cleaner:
Copy code
task release : Copy {  
    from jar   
    [
            'A:/workspaces/plugins'
    ]
    .each {destination -> 
       into destination
    }
}
j
umm
c
you’ll need to lookup the correct Groovy syntax for defining a task/type (haven’t touched Gradle Groovy in quite a while, everything is Kotlin DSL).
j
it should be
Copy code
task release(type: Copy)
but it still doesn't do anything
👍 1
c
are you executing the release task?
j
Sorry forgot lang 😄
c
./gradlew release --info
j
Copy code
Initialized native services in: C:\Users\nexti\.gradle\native                                                                                                                                                                                                             
Initialized jansi services in: C:\Users\nexti\.gradle\native
Found daemon DaemonInfo{pid=18824, address=[b3f1db57-a706-479b-b7fe-f6491d7bfd91 port:60787, addresses:[/127.0.0.1]], state=Idle, lastBusy=1673028515702, context=DefaultDaemonContext[uid=d20d0bdb-c9fb-417b-8c3c-5fed73343ad9,javaHome=C:\Program Files\Java\jdk-17.0.5,
daemonRegistryDir=C:\Users\nexti\.gradle\daemon,pid=18824,idleTimeout=10800000,priority=NORMAL,daemonOpts=--add-opens,java.base/java.util=ALL-UNNAMED,--add-opens,java.base/java.lang=ALL-UNNAMED,--add-opens,java.base/java.lang.invoke=ALL-UNNAMED,--add-opens,java.base
/java.util=ALL-UNNAMED,--add-opens,java.prefs/java.util.prefs=ALL-UNNAMED,--add-opens,java.prefs/java.util.prefs=ALL-UNNAMED,--add-opens,java.base/java.nio.charset=ALL-UNNAMED,--add-opens,java.base/java.net=ALL-UNNAMED,--add-opens,java.base/java.util.concurrent.atomic=ALL-UNNAMED,-XX:MaxMetaspaceSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=windows-1250,-Duser.country=US,-Duser.language=en,-Duser.variant]} however its context does not match the desired criteria.
Java home is different.
Wanted: DefaultDaemonContext[uid=null,javaHome=C:\Program Files\Eclipse Adoptium\jdk-17.0.4.101-hotspot,daemonRegistryDir=C:\Users\nexti\.gradle\daemon,pid=10800,idleTimeout=null,priority=NORMAL,daemonOpts=--add-opens,java.base/java.util=ALL-UNNAMED,--add-opens,java
.base/java.lang=ALL-UNNAMED,--add-opens,java.base/java.lang.invoke=ALL-UNNAMED,--add-opens,java.base/java.util=ALL-UNNAMED,--add-opens,java.prefs/java.util.prefs=ALL-UNNAMED,--add-opens,java.prefs/java.util.prefs=ALL-UNNAMED,--add-opens,java.base/java.nio.charset=AL
L-UNNAMED,--add-opens,java.base/java.net=ALL-UNNAMED,--add-opens,java.base/java.util.concurrent.atomic=ALL-UNNAMED,-XX:MaxMetaspaceSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=windows-1250,-Duser.country=US,-Duser.language=en,-Duser.variant]
Actual: DefaultDaemonContext[uid=d20d0bdb-c9fb-417b-8c3c-5fed73343ad9,javaHome=C:\Program Files\Java\jdk-17.0.5,daemonRegistryDir=C:\Users\nexti\.gradle\daemon,pid=18824,idleTimeout=10800000,priority=NORMAL,daemonOpts=--add-opens,java.base/java.util=ALL-UNNAMED,--ad
d-opens,java.base/java.lang=ALL-UNNAMED,--add-opens,java.base/java.lang.invoke=ALL-UNNAMED,--add-opens,java.base/java.util=ALL-UNNAMED,--add-opens,java.prefs/java.util.prefs=ALL-UNNAMED,--add-opens,java.prefs/java.util.prefs=ALL-UNNAMED,--add-opens,java.base/java.ni
o.charset=ALL-UNNAMED,--add-opens,java.base/java.net=ALL-UNNAMED,--add-opens,java.base/java.util.concurrent.atomic=ALL-UNNAMED,-XX:MaxMetaspaceSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=windows-1250,-Duser.country=US,-Duser.language=en,-Duser.variant]

  Looking for a different daemon...
The client will now receive all logging from the daemon (pid: 14992). The daemon log file: C:\Users\nexti\.gradle\daemon\7.3.3\daemon-14992.out.log
Starting 9th build in daemon [uptime: 41 mins 54.348 secs, performance: 100%, non-heap usage: 22% of 256 MiB]
Using 12 worker leases.
Now considering [A:\Projects\skJson] as hierarchies to watch
Watching the file system is configured to be enabled if available
File system watching is active
Starting Build
Settings evaluated using settings file 'A:\Projects\skJson\settings.gradle'.
Projects loaded. Root project using build file 'A:\Projects\skJson\build.gradle'.
Included projects: [root project 'skJson']

> Configure project :
Evaluating root project 'skJson' using build file 'A:\Projects\skJson\build.gradle'.
All projects evaluated.
Selected primary task 'release' from project :
Tasks to be executed: [task ':compileJava', task ':processResources', task ':classes', task ':jar', task ':release']
Tasks that were excluded: []
:compileJava (Thread[Execution worker for ':',5,main]) started.

> Task :compileJava UP-TO-DATE
Caching disabled for task ':compileJava' because:
  Build cache is disabled
Skipping task ':compileJava' as it is up-to-date.
:compileJava (Thread[Execution worker for ':',5,main]) completed. Took 0.024 secs.
:processResources (Thread[Execution worker for ':',5,main]) started.

> Task :processResources UP-TO-DATE
Caching disabled for task ':processResources' because:
:release (Thread[Execution worker for ':',5,main]) started.

> Task :release UP-TO-DATE
Caching disabled for task ':release' because:
  Build cache is disabled
Skipping task ':release' as it is up-to-date.
:release (Thread[Execution worker for ':',5,main]) completed. Took 0.001 secs.
c
it says it’s up-to-date - are there files in the destination?
j
not at all
c
check that it isn’t off by a directory level or somesuch
and that
jar
task is creating something (perhaps it’s disabled).
j
Copy code
task release(type:Copy) {
    dependsOn build, shadowJar
    from jar, shadowJar
    [
            'A:/plugins/',
            'A:\\workspaces\\plugins'

    ]
            .each {destination ->
                into destination
            }
}
Works ^^
c
yep. jar task isn’t producing anything, can likely remove it.
j
you sure?
when i removed the jar
c
yes. the
from
with a task provides an implicit dependency. Should rarely, if ever, need dependsOn.
j
its present only the shadowed thing
so i need jar too
Thank so much!
c
no worries. Glad that worked out.
j
the problem was also that if the same file was up-dated in another directory that was defined in that array it wrote that it was up-dated, but now fixed.