Christian Ambach
11/08/2024, 3:13 PMbuild.gradle
file is correct. The Java Plugin (or another plugin that pulls in the Java plugin) needs to be in the plugin list before the Hibernate plugin.
During review of my PR on Github, @Steve Ebersole brought up the question if I was using the correct approach while fixing the bug.
It would be nice if someone could have a quick look at the pull request and either comment here (or in the PR) if the chosen approach is the right one and if not, provide a hint how it should be done.
Thank you in advance!
https://github.com/hibernate/hibernate-orm/pull/8770thadhouse
11/12/2024, 12:20 AMplugins {
id "edu.wpi.first.WpilibTools" version "2.0.0"
}
Gives the following error
> Configure project :
Evaluating root project 'gradlerio' using build file 'C:\Users\thadh\Documents\GitHub\thadhouse\gradlerio\build.gradle'.
Resource missing. [HTTP GET: <https://repo.maven.apache.org/maven2/edu/wpi/first/WpilibTools/edu.wpi.first.WpilibTools.gradle.plugin/2.0.0/edu.wpi.first.WpilibTools.gradle.plugin-2.0.0.pom>]
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\thadh\Documents\GitHub\thadhouse\gradlerio\build.gradle' line: 2
* What went wrong:
Plugin [id: 'edu.wpi.first.WpilibTools', version: '2.0.0'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Included Builds (No included builds contain this plugin)
- Plugin Repositories (could not resolve plugin artifact 'edu.wpi.first.WpilibTools:edu.wpi.first.WpilibTools.gradle.plugin:2.0.0')
Searched in the following repositories:
Gradle Central Plugin Repository
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at <https://help.gradle.org>.
Attempting to use a version I published previously works.pgreze
11/13/2024, 7:15 AMbuildSrc/src/main/kotlin/com/company/allprojects/*.gradle.kts
where I split the logic applied by allprojects
or subprojects
blocks across multiple files.
They all need to be applied at the root build.gradle.kts but it happened a newly added plugin apply was forgotten.
To solve this problem, I wrote this buildSrc/src/main/kotlin/com/company/allprojects/apply-all.gradle.kts
logic:
package com.company.allprojects
//
// Programmatically ensure all plugins located in this folder are applied.
//
val PLUGIN_SUFFIX = "gradle.kts"
rootDir.resolve("buildSrc/src/main/kotlin/com/company/allprojects")
.listFiles()
.asSequence()
.filter { it.name != "apply-all.gradle.kts" }
.filter { it.name.endsWith(".gradle.kts") }
.sorted()
.forEach { apply(plugin = "com.company.allprojects.${it.name.removeSuffix(".gradle.kts")}") }
But I'm not sure it's the best solution, even if it's working...
Regardless of the hardcoded path, which is OK because it's only made to be used in this specific project,
could someone point me to a better alternative, or just confirm if it's good enough?Leon Linhart
11/14/2024, 10:12 AMVersionCatalogsExtension
is not yet available when applying a project plugin via settings plugin using Gradle#beforeProject
?
I have multiple repos for microservices with exactly the same layout. I was planning to dedupe my build configuration by creating a settings plugin that does three things:
• Registering an external version catalog
• Including the usual subprojects
• Applying project plugins to each subprojects.
The project plugins were supposed to apply dependencies from the catalog. However, when doing this as described above, I noticed that version catalogs are not accessible at this stage. Is there a better approach this?Nicklas Ansman
11/14/2024, 7:19 PMAdam
11/18/2024, 1:18 PMincludeBuild("build-logic")
breaks my build with classpath errors like this:
Error resolving plugin [id: 'com.org.group.plugin.name', version: '1.0.30']
> The request for this plugin could not be satisfied because the plugin is already on the classpath with an unknown version, so compatibility cannot be checked.
Kelvin Chung
11/19/2024, 12:00 AMExtensiblePolymorphicDomainObjectContainer
that can be used to introspect registered bindings/factories? I have a build that is failing due to
Caused by: org.gradle.api.GradleException: Cannot register a factory for type MyType because a factory for this type is already registered.
It looks like there are internal APIs to do this, but not any public ones, according to API documentation.kyle
11/25/2024, 8:37 PMURL pluginJar = MyPlugin.class.getProtectionDomain().getCodeSource().getLocation();
TextResource bundledTemplate = project.getResources().getText().fromArchiveEntry(pluginJar, "path/to/resource");
var processResourcesTask = project.getTasks().named(JavaPlugin.PROCESS_RESOURCES_TASK_NAME, ProcessResources.class, processResources -> {
processResources.from(bundledTemplate, copy -> {
copy.into("target/project/path");
...
});
});
The hard part is testing. Despite setting org.gradle.java.compile-classpath-packaging=true
in the project-under-test's properties, the plugin jar's codeLocation is always the classes dir, not the jar, causing TRF#fromArchiveEntry
to fail while running tests.
Are there better ways to do this? I don't control the plugin, so while separating the resource to another JAR would be nice and clean I probably can't do that.ysb33r
11/26/2024, 12:27 PMtesting.suites
(from the jvm-test-suite
) in an upgrade of the GradleTest plugin. The latter has its own test task of type GradleTest
which extends Test
.
Does anyone have a quick example of adding a test suite which does not use the default Test task?Andres Almiray
12/04/2024, 10:11 AMjandex-gradle-plugin
that I can’t quite figure out how to fix.
* What went wrong:
An exception occurred applying plugin request [id: 'org.kordamp.gradle.jandex', version: '2.1.0']
> Failed to apply plugin 'org.kordamp.gradle.jandex'.
> class org.kordamp.gradle.plugin.jandex.Banner$Inject cannot be cast to class org.kordamp.gradle.plugin.jandex.Banner (org.kordamp.gradle.plugin.jandex.Banner$Inject is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader @941c416; org.kordamp.gradle.plugin.jandex.Banner is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader @298df917)
The class in question (Banner) is written in Java while the rest of the plugin code is in Groovy. https://github.com/kordamp/jandex-gradle-plugin/blob/master/src/main/groovy/org/kordamp/gradle/plugin/jandex/Banner.java
Latest Gradle, Jandex, and Quarkus were used in the test project
$ gm --version
Using gradle at '/tmp/jandex_1.1.0_bug_reproducer/gradlew' to run buildFile '/tmp/jandex_1.1.0_bug_reproducer/build.gradle':
------------------------------------------------------------
Gradle 8.11.1
------------------------------------------------------------
Build time: 2024-11-20 16:56:46 UTC
Revision: 481cb05a490e0ef9f8620f7873b83bd8a72e7c39
Kotlin: 2.0.20
Groovy: 3.0.22
Ant: Apache Ant(TM) version 1.10.14 compiled on August 16 2023
Launcher JVM: 17.0.4 (Azul Systems, Inc. 17.0.4+8-LTS)
Daemon JVM: /Users/aalmiray/.sdkman/candidates/java/17.0.4-zulu/zulu-17.jdk/Contents/Home (no JDK specified, using current Java home)
OS: Mac OS X 14.3 x86_64
The plugin JAR does not contain the Banner$Inject
class which seems to be created on the fly by Gradle upon loading
$ unzip -l build/libs/jandex-gradle-plugin-2.2.0-SNAPSHOT.jar |grep Banner
291 12-04-2024 11:05 org/kordamp/gradle/plugin/jandex/Banner$Params.class
5647 12-04-2024 11:05 org/kordamp/gradle/plugin/jandex/Banner.class
798 12-04-2024 11:05 org/kordamp/gradle/plugin/jandex/Banner.properties
Martin
12/06/2024, 9:47 AMLogging.getLogger()
, is this possible? Is there a "base" Gradle classloader that I can build on top of? I don't want to use workers because of https://github.com/gradle/gradle/issues/18313efemoney
12/08/2024, 11:09 AMMartin
12/09/2024, 10:47 AMMartin
12/09/2024, 2:02 PMjstat
/`jcmd` my way to the "good" process at the "good" time but wondering if there's something easier?jrod
12/16/2024, 5:52 PMjonathan gafner
12/19/2024, 8:04 AMFrancois Dabonot (Frankois)
12/26/2024, 5:55 PMBig Chungus
12/27/2024, 11:59 PMFrancois Dabonot (Frankois)
01/01/2025, 7:23 PMthadhouse
01/01/2025, 9:08 PM* What went wrong:
A problem occurred evaluating root project 'PathWeaver'.
> Failed to calculate the value of extension 'wpilibVersioning' property 'version'.
> java.lang.IllegalStateException (no error message)
The problem is occuring while evaluating a property. I wonder if thats a special case that isn't supported.efemoney
01/06/2025, 5:36 AMMartin
01/07/2025, 2:55 PMInputDirectory
, can I use PathSensitivity.NONE
for the directory itself but PathSensitivity.RELATIVE
for its contents?Alexey Loubyansky
01/08/2025, 3:04 PMKelvin Chung
01/13/2025, 7:21 PMArchiveOperations.zip()
in the same manner as we have FileSystemOperations.copy()
. Are there any plans to add that to the API - a way to create a zip file in a non-task way (for example, if the zip file is not meant to be a task output) without going through ant?Francois Dabonot (Frankois)
01/14/2025, 8:28 AMSwiftDependency.Package.Remote.Version(
// Repository URL
url = URI("<https://github.com/firebase/firebase-ios-sdk.git>"),
// Libraries from the package
products = {
// Export to Kotlin for use in shared Kotlin code
add(ProductName("FirebaseCore"), exportToKotlin = true) // OK!!
},
// (Optional) Package name, can be required in some cases
packageName = "firebase-ios-sdk",
// Package version
version = "11.6.0",
),
This is not working :
val firebaseDeps =
listOf(
ProductName("FirebaseCore"),
)
SwiftDependency.Package.Remote.Version(
// Repository URL
url = URI("<https://github.com/firebase/firebase-ios-sdk.git>"),
// Libraries from the package
products = {
// Export to Kotlin for use in shared Kotlin code
add(firebaseDeps[0], exportToKotlin = true) // NO OK!!
},
// (Optional) Package name, can be required in some cases
packageName = "firebase-ios-sdk",
// Package version
version = "11.6.0",
),
The error :
> Cannot fingerprint input property 'packageDependencies': value '[Version(url=<https://github.com/firebase/firebase-ios-sdk.git>, packageName=firebase-ios-sdk, version=11.6.0, products=io.github.frankois944.spmForKmp.definition.product.dsl.ProductPackageConfig.() -> kotlin.Unit)]' cannot be serialized.
I understand the error, but why I can’t put a reference inside the add
method?Andres Almiray
01/15/2025, 6:36 AMSergej Koščejev
01/17/2025, 3:47 PMjavaexec
in its action method. Are there any known best practices or do's and don'ts?Shreyash Saitwal
01/20/2025, 6:45 PMimplementation(fileTree("libs"))
) from my plugin. Is there a way to do that?Felix de Souza
01/21/2025, 12:25 AMResolvableDependencies
api? I can get it from the ResolvedConfiguration
API, but that doesn’t have all the nice ArtifactView
stuff + lazinessno
01/24/2025, 9:59 AM