Skip to content

Commit

Permalink
fix(abg): use correct coordinates in generated POM file
Browse files Browse the repository at this point in the history
  • Loading branch information
Vampire committed Sep 6, 2024
1 parent 661afcc commit 9a9ba1a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
package io.github.typesafegithub.workflows.mavenbinding

import io.github.typesafegithub.workflows.actionbindinggenerator.domain.ActionCoords

internal const val LATEST_RELASED_LIBRARY_VERSION = "3.0.0"

internal fun buildPomFile(
owner: String,
name: String,
version: String,
): String {
val nameForRepo = name.substringBefore("/")
internal fun ActionCoords.buildPomFile(): String {
val nameForRepo = name.substringBefore("__")
val nameForDisplay = name.replace("__", "/")
return """
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>$owner</groupId>
<artifactId>$name</artifactId>
<version>$version</version>
<name>$name</name>
<description>Auto-generated binding for $owner/$name@$version.</description>
<name>$nameForDisplay</name>
<description>Auto-generated binding for $owner/$nameForDisplay@$version.</description>
<url>https://github.com/$owner/$nameForRepo</url>
<scm>
<connection>scm:git:git://github.com/$owner/$nameForRepo.git/</connection>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ data class JarArtifact(

fun ActionCoords.buildVersionArtifacts(types: String? = null): Map<String, Artifact>? {
val jars = buildJars(owner = owner, name = name.replace("__", "/"), version = version, types = types) ?: return null
val pom = buildPomFile(owner = owner, name = name.replace("__", "/"), version = version)
val pom = buildPomFile()
val module = buildModuleFile()
return mapOf(
"$name-$version.jar" to JarArtifact(jars.mainJar),
Expand Down

0 comments on commit 9a9ba1a

Please sign in to comment.