Skip to content

Commit

Permalink
rearranging
Browse files Browse the repository at this point in the history
  • Loading branch information
evanchooly committed Aug 31, 2023
1 parent a4a728b commit 7b9b92f
Show file tree
Hide file tree
Showing 25 changed files with 57 additions and 57 deletions.
2 changes: 1 addition & 1 deletion integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.antwerkz.graven</groupId>
<artifactId>graven-parent</artifactId>
<version>0.4.0-SNAPSHOT</version>
<version>0.4.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.antwerkz.build.maven
package com.antwerkz.graven.maven

import com.antwerkz.build.maven.MavenTester.Companion.initProject
import java.io.File
import org.testng.Assert.assertTrue
import org.testng.annotations.Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.antwerkz.build.maven
package com.antwerkz.graven.maven

import org.apache.maven.shared.invoker.InvocationResult
import org.apache.maven.shared.utils.cli.CommandLineException
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.antwerkz.build.maven;
package com.antwerkz.graven.maven;

import org.apache.maven.shared.invoker.*;
import org.apache.maven.shared.utils.cli.CommandLineException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.antwerkz.build.maven
package com.antwerkz.graven.maven

import java.io.File
import java.io.FileNotFoundException
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.antwerkz.build.maven
package com.antwerkz.graven.maven

import java.io.File
import java.nio.charset.Charset
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.antwerkz.build.maven
package com.antwerkz.graven.maven

import java.io.File
import java.io.IOException
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package com.antwerkz.build
package com.antwerkz.graven

class DoubleQuotes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.antwerkz.build
package com.antwerkz.graven

class GradleDummy {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.antwerkz.build
package com.antwerkz.graven

class DummyTest {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.antwerkz.build
package com.antwerkz.graven

class SampleClass {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.antwerkz.build
package com.antwerkz.graven

class SampleClass {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.antwerkz.build
package com.antwerkz.graven

class SampleClass {
i should fail
Expand Down
2 changes: 1 addition & 1 deletion mojo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.antwerkz.graven</groupId>
<artifactId>graven-parent</artifactId>
<version>0.4.0-SNAPSHOT</version>
<version>0.4.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.antwerkz.build
package com.antwerkz.graven

import com.antwerkz.build.GradleInvocationMojo.Companion.MOJO_NAME
import com.antwerkz.graven.GradleInvocationMojo.Companion.MOJO_NAME
import com.antwerkz.graven.model.GradleTask
import java.io.File
import java.io.FileOutputStream
import org.apache.maven.plugin.AbstractMojo
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.antwerkz.build
package com.antwerkz.graven

import com.antwerkz.build.model.TargetPlugin
import com.antwerkz.graven.model.TargetPlugin
import java.io.File
import java.util.Properties
import javax.inject.Named
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.antwerkz.build
package com.antwerkz.graven

import com.antwerkz.graven.model.RegexReplacement
import com.antwerkz.expression.RegularExpression
import com.antwerkz.expression.toRegex
import com.fasterxml.jackson.annotation.JsonRootName
import java.io.File
import java.io.IOException
import java.nio.charset.Charset
Expand Down Expand Up @@ -120,28 +120,6 @@ class ReplacementMojo : AbstractMojo() {
}
}

@JsonRootName("replacement")
class RegexReplacement() {
lateinit var pattern: String
lateinit var value: String
private val regex by lazy { Regex(pattern) }

constructor(pattern: String, value: String) : this() {
this.pattern = pattern
this.value = value
}

fun replace(input: String): String {
return input.replace(regex, value)
}

override fun toString(): String {
return "Replacement(pattern='$pattern', value='$value')"
}
}

data class MappedProperty(var gradleProperty: String = "", var mavenProperty: String = "")

fun List<Dependency>.groupDeps(): Map<String, Dependency> {
return groupBy { "${it.groupId}:${it.artifactId}" }.map { it.key to it.value.first() }.toMap()
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package com.antwerkz.build
package com.antwerkz.graven

import com.antwerkz.build.UpdateValues.matcher
import com.antwerkz.build.UpdateValues.propertyMatcher
import com.antwerkz.graven.UpdateValues.matcher
import com.antwerkz.graven.UpdateValues.propertyMatcher
import com.antwerkz.expression.RegularExpression.Companion.capture
import com.antwerkz.expression.RegularExpression.Companion.oneOrMore
import com.antwerkz.expression.RegularExpression.Companion.oneOrMoreLazy
import com.antwerkz.expression.toRegex
import org.apache.maven.model.Dependency

@Suppress("unused")
enum class Updaters {
DOUBLE_QUOTED_VERSIONS {
override fun create(input: String): DepReplacer {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.antwerkz.build
package com.antwerkz.graven.model

import com.fasterxml.jackson.annotation.JsonRootName

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.antwerkz.build
package com.antwerkz.graven.model

import com.fasterxml.jackson.annotation.JsonRootName

Expand Down
23 changes: 23 additions & 0 deletions mojo/src/main/kotlin/com/antwerkz/graven/model/RegexReplacement.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.antwerkz.graven.model

import com.fasterxml.jackson.annotation.JsonRootName

@JsonRootName("replacement")
class RegexReplacement() {
lateinit var pattern: String
lateinit var value: String
private val regex by lazy { Regex(pattern) }

constructor(pattern: String, value: String) : this() {
this.pattern = pattern
this.value = value
}

fun replace(input: String): String {
return input.replace(regex, value)
}

override fun toString(): String {
return "Replacement(pattern='$pattern', value='$value')"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.antwerkz.build.model
package com.antwerkz.graven.model

data class TargetPlugin(
val groupId: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.antwerkz.build
package com.antwerkz.graven

import com.antwerkz.graven.model.RegexReplacement
import org.apache.maven.model.Dependency
import org.testng.Assert.assertEquals
import org.testng.annotations.DataProvider
Expand Down
3 changes: 0 additions & 3 deletions mojo/src/test/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,5 @@
<root level="warn">
<appender-ref ref="STDOUT" />
</root>
<logger name="com.antwerkz.bottlerocket" level="warn">
<appender-ref ref="STDOUT" />
</logger>

</configuration>
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@

<groupId>com.antwerkz.graven</groupId>
<artifactId>graven-parent</artifactId>
<version>0.4.0-SNAPSHOT</version>
<version>0.4.1-SNAPSHOT</version>
<packaging>pom</packaging>

<name>graven</name>
<description>
This plugin drives a gradle build from maven allowing for single-lifecycle development on mixed build projects
</description>
Expand All @@ -28,6 +27,7 @@

<properties>
<jackson.version>2.15.2</jackson.version>
<maven.version>3.9.3</maven.version>

<kotlin.code.style>official</kotlin.code.style>
</properties>
Expand All @@ -54,7 +54,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.9.4</version>
<version>${maven.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -65,7 +65,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.9.4</version>
<version>${maven.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down

0 comments on commit 7b9b92f

Please sign in to comment.