Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(#2327): remove the old hash attribute #2448

Merged
merged 2 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion eo-maven-plugin/src/it/custom_goals/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ SOFTWARE.
<configuration>
<foreign>${project.basedir}/target/eo/foreign.csv</foreign>
<foreignFormat>csv</foreignFormat>
<hash>master</hash>
</configuration>
<executions>
<execution>
Expand Down
3 changes: 0 additions & 3 deletions eo-maven-plugin/src/it/duplicate_classes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ SOFTWARE.
<groupId>org.eolang</groupId>
<artifactId>eo-maven-plugin</artifactId>
<version>@project.version@</version>
<configuration>
<hash>master</hash>
</configuration>
<executions>
<execution>
<id>compile</id>
Expand Down
13 changes: 0 additions & 13 deletions eo-maven-plugin/src/main/java/org/eolang/maven/AssembleMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,6 @@ public final class AssembleMojo extends SafeMojo {
@Parameter(property = "eo.overWrite", required = true, defaultValue = "false")
private boolean overWrite;

/**
* The Git tag to pull objects from, in objectionary.
* @since 0.21.0
* @todo #2302:30min Rename the parameter "hash". This parameter is actually
* a tag, not a hash. By this tag application actually finds hash and then
* uses it. So need to rename this parameter to "tag" and rename it in all
* places where it's used. Also it would be better to use name "hash" for
* parameter "hsh" in {@link ProbeMojo} and {@link PullMojo}
*/
@SuppressWarnings("PMD.ImmutableField")
@Parameter(property = "eo.hash", required = true, defaultValue = "master")
private String hash = "master";
Graur marked this conversation as resolved.
Show resolved Hide resolved

/**
* Skip artifact with the version 0.0.0.
* @checkstyle MemberNameCheck (7 lines)
Expand Down
10 changes: 5 additions & 5 deletions eo-maven-plugin/src/main/java/org/eolang/maven/ProbeMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public final class ProbeMojo extends SafeMojo {
* @since 0.29.6
*/
@SuppressWarnings("PMD.ImmutableField")
private CommitHash hsh;
private CommitHash hash;

/**
* Objectionaries.
Expand All @@ -99,8 +99,8 @@ public final class ProbeMojo extends SafeMojo {

@Override
public void exec() throws IOException {
if (this.hsh == null) {
this.hsh = new ChCached(
if (this.hash == null) {
this.hash = new ChCached(
new ChNarrow(
new ChRemote(this.tag)
)
Expand Down Expand Up @@ -129,7 +129,7 @@ public void exec() throws IOException {
new ChNarrow(
new OnSwap(
this.withVersions,
new OnVersioned(tojo.identifier(), this.hsh)
new OnVersioned(tojo.identifier(), this.hash)
).hash()
)
).withProbed(count);
Expand Down Expand Up @@ -168,7 +168,7 @@ private Collection<ObjectName> probes(final Path file) throws FileNotFoundExcept
this.withVersions,
new OnVersioned(
new OnReplaced(ProbeMojo.noPrefix(obj), this.hashes),
this.hsh
this.hash
)
)
),
Expand Down
8 changes: 4 additions & 4 deletions eo-maven-plugin/src/main/java/org/eolang/maven/PullMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public final class PullMojo extends SafeMojo {
* @since 0.29.6
*/
@SuppressWarnings("PMD.ImmutableField")
private CommitHash hsh;
private CommitHash hash;

/**
* Objectionaries.
Expand All @@ -99,8 +99,8 @@ public final class PullMojo extends SafeMojo {

@Override
public void exec() throws IOException {
if (this.hsh == null) {
this.hsh = new ChCached(
if (this.hash == null) {
this.hash = new ChCached(
new ChNarrow(
new ChRemote(this.tag)
)
Expand All @@ -112,7 +112,7 @@ public void exec() throws IOException {
final ObjectName name = new OnCached(
new OnSwap(
this.withVersions,
new OnVersioned(tojo.identifier(), this.hsh)
new OnVersioned(tojo.identifier(), this.hash)
)
);
names.add(name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void findsProbesViaOfflineHashFile(@TempDir final Path temp) throws IOException
),
new FakeMaven(temp)
.with(
"hsh",
"hash",
new ChCached(
new ChText(temp.resolve("tags.txt"), tag)
)
Expand All @@ -113,7 +113,7 @@ void findsProbesViaOfflineHash(@TempDir final Path temp) throws IOException {
MatcherAssert.assertThat(
"The hash of the program tojo should be equal to the given hash pattern",
new FakeMaven(temp)
.with("hsh", new ChPattern("*.*.*:abcdefg", "1.0.0"))
.with("hash", new ChPattern("*.*.*:abcdefg", "1.0.0"))
.withProgram(ProbeMojoTest.program())
.execute(new FakeMaven.Probe())
.programTojo()
Expand Down Expand Up @@ -150,7 +150,7 @@ void findsProbesInOyRemote(@TempDir final Path temp) throws IOException {
void findsProbesWithVersionsInOneObjectionary(@TempDir final Path temp) throws IOException {
final CommitHash hash = new CommitHashesMap.Fake().get("0.28.5");
final FakeMaven maven = new FakeMaven(temp)
.with("hsh", hash)
.with("hash", hash)
.with("objectionaries", new Objectionaries.Fake(new OyRemote(hash)))
.with("withVersions", true)
.withVersionedHelloWorld()
Expand Down Expand Up @@ -191,7 +191,7 @@ void findsProbesWithVersionsInDifferentObjectionaries(@TempDir final Path temp)
)
)
.with("withVersions", true)
.with("hsh", first)
.with("hash", first)
.withVersionedProgram()
.execute(new FakeMaven.Probe());
final ObjectName text = new OnVersioned("org.eolang.txt.text", "5f82cc1");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void pullsUsingOfflineHashFile(@TempDir final Path temp) throws IOException {
.withVersion("*.*.*");
maven.with("skip", false)
.with(
"hsh",
"hash",
new ChCached(new ChText(temp.resolve("tags.txt"), "master"))
)
.execute(PullMojo.class);
Expand All @@ -147,7 +147,7 @@ void pullsUsingOfflineHash(@TempDir final Path temp) throws IOException {
.withVersion("*.*.*");
maven.with("skip", false)
.with(
"hsh",
"hash",
new ChCached(new ChPattern("*.*.*:abcdefg", "1.0.0"))
)
.execute(PullMojo.class);
Expand Down Expand Up @@ -234,7 +234,7 @@ void pullsProbedVersionedObjectsFromDifferentObjectionaries(@TempDir final Path
)
)
.with("withVersions", true)
.with("hsh", fourth)
.with("hash", fourth)
.withVersionedProgram()
.execute(new FakeMaven.Pull());
final ObjectName sprintf = new OnVersioned("org.eolang.txt.sprintf", "17f8929");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ private static int run(
.withProgram(code)
.with("sourcesDir", src.toFile())
.with("objects", Arrays.asList("org.eolang.bool"))
.with("hsh", hash)
.with("hash", hash)
.with("objectionaries", new Objectionaries.Fake(new OyFilesystem()));
maven.execute(RegisterMojo.class);
maven.execute(DemandMojo.class);
Expand Down
1 change: 0 additions & 1 deletion eo-runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ SOFTWARE.
<configuration>
<foreign>${project.basedir}/target/eo-foreign.csv</foreign>
<foreignFormat>csv</foreignFormat>
<hash>master</hash>
<failOnWarning>true</failOnWarning>
</configuration>
<executions>
Expand Down
Loading