redmaster east
12/24/2024, 7:57 AMval commonDist = project.copySpec {
from(layout.projectDirectory.dir("packageFiles/common")) {
into("")
filesMatching("test.cfg") {
println(name)
println("test")
println(file.exists())
filePermissions {
user {
read = true
write = true
}
group {
read = true
}
other {
read = true
}
}
}
}
}
1: Task failed with an exception.
-----------
* What went wrong:
Could not load the value of field `delegate` of `org.gradle.api.internal.file.copy.CopySpecWrapper_Decorated` bean found in field `$this_from` of `Build_gradle$commonDist$1$1$1` bean found in field `toApply` of `org.gradle.api.internal.file.copy.MatchingCopyAction` bean found in field `mainSpec` of task `:commonFiles` of type `org.gradle.api.tasks.Sync`.
> null cannot be cast to non-null type org.gradle.api.file.FileCollection
Vampire
12/24/2024, 12:09 PMredmaster east
12/24/2024, 6:48 PMVampire
12/25/2024, 12:37 AMredmaster east
12/25/2024, 1:02 AMVampire
12/25/2024, 1:07 AMredmaster east
12/25/2024, 1:12 AMredmaster east
12/25/2024, 1:12 AMredmaster east
12/25/2024, 1:13 AMproject.sync
as well as a few Sync
tasksVampire
12/25/2024, 1:17 AMorg.gradle.configuration-cache.problems=warn
or --configuration-cache-problems=warn
?redmaster east
12/25/2024, 1:19 AMorg.gradle.configuration-cache=true
org.gradle.configuration-cache.parallel=true
org.gradle.warning.mode=all
org.gradle.configureondemand=true
Vampire
12/25/2024, 1:20 AMredmaster east
12/25/2024, 1:21 AMThread
? I dond't have anything like that:
tasks.register<Sync>("commonFiles") {
with(commonDist)
into(layout.buildDirectory.dir("commonFiles"))
}
Vampire
12/25/2024, 1:22 AMVampire
12/25/2024, 1:22 AMredmaster east
12/25/2024, 1:26 AMVampire
12/25/2024, 1:26 AMredmaster east
12/25/2024, 1:31 AMVampire
12/25/2024, 1:57 AMredmaster east
12/25/2024, 1:58 AMcommonFilles
Vampire
12/25/2024, 1:58 AMredmaster east
12/25/2024, 1:59 AMVampire
12/25/2024, 2:03 AMfilePermissions
within filesMatching
does not make much sense anyway.
If you (just temporary for better ide clearness) add this.
in front of filePermissions
, or navigate to it with Ctrl+Click
, you see that it is not from the file copy details in the filesMatching
but from the copy spec.Vampire
12/25/2024, 2:05 AMbuild/
, I still get the "final" error, not the "null" errorVampire
12/25/2024, 2:05 AMgw clean commonFiles
redmaster east
12/25/2024, 2:05 AMVampire
12/25/2024, 2:05 AMredmaster east
12/25/2024, 2:05 AMVampire
12/25/2024, 2:06 AMredmaster east
12/25/2024, 2:07 AMpermissions
seems to have fixed it, thanks. I didn't realize it worked that wayVampire
12/25/2024, 2:07 AMpermissions
was it in the filesMatching
, exactly.Vampire
12/25/2024, 2:08 AMfilePermissions
out of the filesMatching
at least solved the "final" error, probably also the "null" error, but of course would not be the semantic you intended.redmaster east
12/25/2024, 2:10 AMredmaster east
12/25/2024, 2:16 AMconfigure<PackagePluginExtension>
Plugin code to get the extension which appears null: PackagePluginExtension extension = getProject().getExtensions().findByType(PackagePluginExtension.class);
<https://gradle.com/s/jrotixbbri32g>redmaster east
12/25/2024, 2:17 AMVampire
12/25/2024, 2:21 AMfindByType
and get null
, that usually either means the extension was not registered yet, or the type does not match, for example if it it was registered with a class named PackagePluginExtension
from one class loader but looked up with a class named PackagePluginExtension
from a different class loader which makes them different classes even if their FQCN is the same. But hard to say from only a message or scanredmaster east
12/25/2024, 2:23 AMVampire
12/25/2024, 2:24 AMfilePermissions
to permissions
then it is unlikely this causes it. 🤷♂️redmaster east
12/25/2024, 2:24 AMorg.gradle.configuration-cache.problems=warn
. Why does that break things?Vampire
12/25/2024, 2:24 AMVampire
12/25/2024, 2:25 AMVampire
12/25/2024, 2:27 AMredmaster east
12/25/2024, 2:29 AMredmaster east
12/25/2024, 2:30 AM