Skip to content

Commit

Permalink
iternal classes moved around
Browse files Browse the repository at this point in the history
  • Loading branch information
morisil committed Jan 21, 2025
1 parent 0c4228f commit 6ec3c00
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 145 deletions.
63 changes: 0 additions & 63 deletions src/main/kotlin/Poms.kt

This file was deleted.

66 changes: 0 additions & 66 deletions src/main/kotlin/UpdateVersionInReadme.kt

This file was deleted.

8 changes: 5 additions & 3 deletions src/main/kotlin/Jars.kt → src/main/kotlin/internal/Jars.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@
* limitations under the License.
*/

package com.xemantic.gradle.conventions
package com.xemantic.gradle.conventions.internal

import com.xemantic.gradle.conventions.xemantic
import org.gradle.api.Project
import org.gradle.api.tasks.bundling.Jar

/**
* Each JAR file has also a manifest, and the manifest can contain additional
* information related to the vendor and the build.
* Populates JAR manifest with Xemantic-specific and build specific attributes.
*
* @param project the gradle project.
*/
internal fun Jar.populateJarManifest(
project: Project,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.xemantic.gradle.conventions
package com.xemantic.gradle.conventions.internal

/**
* Replaces the version of a Gradle dependency in a string.
Expand All @@ -33,14 +33,13 @@ package com.xemantic.gradle.conventions
* @param newVersion The new version to set for the artifact.
* @return A new string with the updated version for the specified artifact.
*/
fun String.replaceGradleDependencyVersion(
internal fun String.replaceGradleDependencyVersion(
artifact: String,
newVersion: String
): String {
val regex = """"$artifact(-[^:]*)?:([^":]+)(:([^"]+))?"""".toRegex()
return this.replace(regex) { matchResult ->
val (variant, _, _, classifier) = matchResult.destructured
val classifierPart = if (classifier.isNotEmpty()) ":$classifier" else ""
""""$artifact$variant:$newVersion$classifierPart""""
}
): String = replace(
""""$artifact(-[^:]*)?:([^":]+)(:([^"]+))?"""".toRegex()
) { matchResult ->
val (variant, _, _, classifier) = matchResult.destructured
val classifierPart = if (classifier.isNotEmpty()) ":$classifier" else ""
""""$artifact$variant:$newVersion$classifierPart""""
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,19 @@
* limitations under the License.
*/

package com.xemantic.gradle.conventions
package com.xemantic.gradle.conventions.internal

import com.xemantic.gradle.conventions.XemanticConfiguration
import org.gradle.api.publish.PublishingExtension
import org.gradle.plugins.signing.SigningExtension

public fun SigningExtension.xemanticSigning(
/**
* Configures signing of maven publications.
*
* @param xemantic the Xemantic configuration instance.
* @param publishing the publishing gradle extension to retrieve publication list from.
*/
internal fun SigningExtension.xemanticSigning(
xemantic: XemanticConfiguration,
publishing: PublishingExtension
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.xemantic.gradle.conventions
package com.xemantic.gradle.conventions.internal

import org.gradle.api.tasks.testing.Test
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
Expand All @@ -27,7 +27,7 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent
* convenient for digestion of not only a human, but also an AI agent performing the
* build and the analysis of possible build failures.
*/
fun Test.xemanticTestLogging() {
internal fun Test.xemanticTestLogging() {
testLogging {
events(
TestLogEvent.SKIPPED,
Expand Down

0 comments on commit 6ec3c00

Please sign in to comment.