Skip to content

Commit

Permalink
Merge pull request #4 from trydofor/develop
Browse files Browse the repository at this point in the history
🎂 remove hashCode, equals
  • Loading branch information
trydofor authored Jan 29, 2024
2 parents d430840 + 0fc99da commit 3043087
Show file tree
Hide file tree
Showing 44 changed files with 333 additions and 575 deletions.
84 changes: 50 additions & 34 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,46 @@ on:
workflow_dispatch:
inputs:
testCoverReport:
description: 'test and coveralls report?'
description: 'test and coverage report?'
default: true
type: boolean
required: false
testFailureIgnore:
description: 'maven.test.failure.ignore?'
description: 'test ignore failure?'
default: false
type: boolean
required: false
testVerbose:
description: 'test output verbose'
default: false
type: boolean
required: false
deployOssrh:
description: 'deploy to ossrh?'
default: true
type: boolean
required: false
release:
types: [published]

jobs:
release:
name: Release to Sonatype
runs-on: ubuntu-latest
env:
MAVEN_OPTS: -Xmx2g
TEST_VERBOSE: ${{ inputs.testVerbose }}

steps:
- name: Checkout ${{github.event.release.tag_name}}
uses: actions/checkout@v4
with:
fetch-depth: 10

## chache asdf/, m2/repository
- name: Cache Sdk & Repo
id: cache-sdk-repo
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.asdf/
Expand All @@ -37,13 +53,32 @@ jobs:

## install jdk and maven
- name: Install asdf & tools
uses: asdf-vm/actions/install@v2
uses: asdf-vm/actions/install@v3
with:
skip_install: ${{steps.cache-sdk-repo.outputs.cache-hit == 'true'}}

## write settings.xml
- name: Maven settings.xml
id: settings
run: |
JAVA_HOME=$(asdf where java)
echo "JAVA_HOME=$JAVA_HOME" >> "$GITHUB_OUTPUT"
echo "GIT_BRANCH=$(git branch --show-current)" >> "$GITHUB_OUTPUT"
_opt=$(git describe --tags --exact-match 2>/dev/null || true)
if [ "$_opt" != "" ]; then
_opt="-Drevision=$_opt"
echo $_opt
echo "MVN_REVISION=$_opt" >> "$GITHUB_OUTPUT"
fi
_ver=$(mvn --quiet --non-recursive -DforceStdout -Dexpression=project.version $_opt help:evaluate)
echo $_ver
echo "WINGS_VERSION=$_ver" >> "$GITHUB_OUTPUT"
mvn -v
git --no-pager log --graph -10 --pretty=format:'%H - %ai %d %s'
mkdir -p ~/.m2
cat > ~/.m2/settings.xml << "EOF"
<settings>
Expand All @@ -57,56 +92,37 @@ jobs:
</servers>
</settings>
EOF
## get JAVA_HOME
- name: Env JAVA_HOME
id: java-env
run: echo "JAVA_HOME=$(asdf where java)" >> "$GITHUB_OUTPUT"
## get revision if release
- name: Opt revision
id: opt-revision
if: github.event.release.tag_name != ''
run: echo "OPT_REVISION=-Drevision=${{github.event.release.tag_name}}" >> "$GITHUB_OUTPUT"
## info deploy
- name: Info Deploy
run: |
mvn --quiet --non-recursive -DforceStdout -Dexpression=project.version ${{ steps.opt-revision.outputs.OPT_REVISION }} help:evaluate
echo
mvn -v
git --no-pager log --graph -10 --pretty=format:'%H - %an, %ad %d : %s'
env:
JAVA_HOME: ${{ steps.java-env.outputs.JAVA_HOME }}
## ci report if not release
- name: Coveralls Report
## report if not release
- name: Test Coverage ${{ steps.settings.outputs.WINGS_VERSION }} ${{ steps.settings.outputs.GIT_BRANCH }}
if: inputs.testCoverReport
run: >
mvn
--quiet
--fail-at-end
-P ci
-Dtest-verbose=false
-Dmaven.test.skip=false
-P coverage
-Dmaven.test.failure.ignore=${{ inputs.testFailureIgnore }}
-DrepoToken=${{ secrets.COVERALLS_REPO_TOKEN }}
clean test jacoco:report coveralls:report
env:
JAVA_HOME: ${{ steps.java-env.outputs.JAVA_HOME }}
JAVA_HOME: ${{ steps.settings.outputs.JAVA_HOME }}
## import gpp private key
- name: Import GPG key
if: inputs.deployOssrh
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.MVN_GPG_SKEY }}
passphrase: ${{ secrets.MVN_GPG_PASS }}

## maven deploy
- name: Maven Deploy
- name: Deploy ${{ steps.settings.outputs.WINGS_VERSION }} ${{ steps.settings.outputs.GIT_BRANCH }}
if: inputs.deployOssrh
run: >
mvn
-P ossrh
${{ steps.opt-revision.outputs.OPT_REVISION }}
${{ steps.settings.outputs.MVN_REVISION }}
-Dgpg.passphrase=${MVN_GPG_PASS}
-Dmaven.test.skip=true
clean deploy
env:
JAVA_HOME: ${{ steps.java-env.outputs.JAVA_HOME }}
JAVA_HOME: ${{ steps.settings.outputs.JAVA_HOME }}
MVN_OSS_USER: ${{ secrets.MVN_OSS_USER }}
MVN_OSS_PASS: ${{ secrets.MVN_OSS_PASS }}
MVN_GPG_PASS: ${{ secrets.MVN_GPG_PASS }}
8 changes: 7 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@
<profiles>
<profile>
<!-- -DrepoToken=${{ secrets.COVERALLS_REPO_TOKEN }} -->
<id>ci</id>
<id>coverage</id>
<properties>
<maven.test.skip>false</maven.test.skip>
</properties>
Expand All @@ -279,6 +279,12 @@
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.11</version>
<configuration>
<excludes>
<!-- just for fun -->
<exclude>**/WhoAmI.*</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>prepare-agent</id>
Expand Down
14 changes: 0 additions & 14 deletions src/main/java/pro/fessional/meepo/bind/Exon.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import java.io.Writer;
import java.util.Collections;
import java.util.List;
import java.util.Objects;

/**
* <pre>
Expand Down Expand Up @@ -114,18 +113,5 @@ public boolean cross(N o) {
public int compareTo(@NotNull Exon.N o) {
return start == o.start ? o.until - until : start - o.start;
}

@Override
public int hashCode() {
return Objects.hash(start, until, xna);
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof N)) return false;
N n = (N) o;
return start == n.start && until == n.until && Objects.equals(xna, n.xna);
}
}
}
14 changes: 0 additions & 14 deletions src/main/java/pro/fessional/meepo/bind/dna/DnaBkb.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;
import java.util.Objects;

/**
* <pre>
Expand Down Expand Up @@ -38,19 +37,6 @@ public DnaBkb(String text, Clop edge, @NotNull String name) {
this.name9 = name.toCharArray();
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
DnaBkb dnaBkb = (DnaBkb) o;
return name.equals(dnaBkb.name);
}

@Override
public int hashCode() {
return Objects.hash(name);
}

@Override
public String toString() {
StringWriter buff = new StringWriter();
Expand Down
14 changes: 0 additions & 14 deletions src/main/java/pro/fessional/meepo/bind/dna/DnaEnd.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;

/**
Expand Down Expand Up @@ -45,19 +44,6 @@ public DnaEnd(String text, Clop edge, Collection<String> name) {
}
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
DnaEnd dnaEnd = (DnaEnd) o;
return name.equals(dnaEnd.name);
}

@Override
public int hashCode() {
return Objects.hash(name);
}

@Override
public String toString() {
StringWriter buff = new StringWriter();
Expand Down
14 changes: 0 additions & 14 deletions src/main/java/pro/fessional/meepo/bind/dna/DnaRaw.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;
import java.util.Arrays;

/**
* <pre>
Expand Down Expand Up @@ -38,19 +37,6 @@ public void merge(Acid acid, Writer buff) {
Dent.write(buff, body9);
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
DnaRaw dnaRaw = (DnaRaw) o;
return Arrays.equals(body9, dnaRaw.body9);
}

@Override
public int hashCode() {
return Arrays.hashCode(body9);
}

@Override
public String toString() {
StringWriter buff = new StringWriter();
Expand Down
16 changes: 0 additions & 16 deletions src/main/java/pro/fessional/meepo/bind/dna/DnaSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import java.io.Writer;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.regex.Pattern;

/**
Expand Down Expand Up @@ -62,21 +61,6 @@ public Life.State match(List<N> lst, String txt) {
}
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
DnaSet dnaSet = (DnaSet) o;
return Objects.equals(find.pattern(), dnaSet.find.pattern()) &&
Objects.equals(repl, dnaSet.repl) &&
Objects.equals(life, dnaSet.life);
}

@Override
public int hashCode() {
return Objects.hash(find.pattern(), repl, life);
}

@Override
public String toString() {
StringWriter buff = new StringWriter();
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/pro/fessional/meepo/bind/dna/DnaSon.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ public void merge(Acid acid, Writer buff) {
}
}

@Override
public int hashCode() {
return path.hashCode();
}

@Override
public String toString() {
StringWriter buff = new StringWriter();
Expand Down
15 changes: 0 additions & 15 deletions src/main/java/pro/fessional/meepo/bind/rna/RnaDone.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;

/**
Expand Down Expand Up @@ -59,20 +58,6 @@ public void merge(Acid acid, Writer buff) {
}
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
RnaDone rnaDone = (RnaDone) o;
return name.equals(rnaDone.name) &&
tock.equals(rnaDone.tock);
}

@Override
public int hashCode() {
return Objects.hash(name, tock);
}

@Override
public String toString() {
StringWriter buff = new StringWriter();
Expand Down
19 changes: 0 additions & 19 deletions src/main/java/pro/fessional/meepo/bind/rna/RnaEach.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.RandomAccess;

import static pro.fessional.meepo.bind.Const.BLT$EACH_COUNT;
Expand Down Expand Up @@ -205,24 +204,6 @@ private void loop(Acid acid, Writer buf, Object obj, int size,
}
}


@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
RnaEach rnaEach = (RnaEach) o;
return mute == rnaEach.mute &&
step == rnaEach.step &&
tock.equals(rnaEach.tock) &&
type.equals(rnaEach.type) &&
expr.equals(rnaEach.expr);
}

@Override
public int hashCode() {
return Objects.hash(tock, type, step, expr, mute);
}

@Override
public String toString() {
StringWriter buff = new StringWriter();
Expand Down
Loading

0 comments on commit 3043087

Please sign in to comment.