Skip to content

Commit b52a72e

Browse files
authored
Merge pull request #1 from celeduc/mavenize
Mavenize
2 parents 4133208 + 06abb30 commit b52a72e

File tree

5 files changed

+155
-13
lines changed

5 files changed

+155
-13
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
*.class
22

3+
target/**
34
build/**
45
dist/**
56
.idea/**

README.md

Lines changed: 61 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# java-multibase
2-
A Java implementation of Multibase
2+
3+
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
4+
[![](https://img.shields.io/badge/project-multiformats-blue.svg?style=flat-square)](http://github.com/multiformats/multiformats)
5+
[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
6+
7+
A Java implementation of [Multibase](https://github.com/multiformats/multibase)
38

49
## Usage
510
```java
@@ -8,5 +13,58 @@ String encoded = Multibase.encode(Multibase.Base.Base58BTC, data);
813
byte[] decoded = Multibase.decode(encoded);
914
```
1015

11-
## Compilation
12-
To compile just run ant.
16+
## Dependency
17+
You can use this project by building the JAR file as specified below, or by using [JitPack](https://jitpack.io/#multiformats/java-multibase/) (also supporting Gradle, SBT, etc).
18+
19+
for Maven, you can add the follwing sections to your POM.XML:
20+
```
21+
<repositories>
22+
<repository>
23+
<id>jitpack.io</id>
24+
<url>https://jitpack.io</url>
25+
</repository>
26+
</repositories>
27+
28+
<dependencies>
29+
<dependency>
30+
<groupId>com.github.multiformats</groupId>
31+
<artifactId>java-multibase</artifactId>
32+
<version>v1.0.0</version>
33+
</dependency>
34+
</dependencies>
35+
```
36+
37+
## Testing
38+
39+
### Ant
40+
`ant test`
41+
42+
### Maven
43+
`mvn test`
44+
45+
## Building
46+
47+
### Ant
48+
`ant dist` will build a JAR file in the `./dist` suitable for manual inclusion in a project. Dependent libraries are included in `./dist/lib`.
49+
50+
### Maven
51+
`mvn package` will build a JAR file with Maven dependency information.
52+
53+
## Releasing
54+
The version number is specified in `build.xml` and `pom.xml` and must be changed in both places in order to be accurately reflected in the JAR file manifest. A git tag must be added in the format "vx.x.x" for JitPack to work.
55+
56+
## Maintainers
57+
58+
Captain: [@ianopolous](https://github.com/ianopolous).
59+
60+
## Contribute
61+
62+
Contributions welcome. Please check out [the issues](https://github.com/multiformats/java-multibase/issues).
63+
64+
Check out our [contributing document](https://github.com/multiformats/multiformats/blob/master/contributing.md) for more information on how we work, and about contributing in general. Please be aware that all interactions related to multiformats are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).
65+
66+
Small note: If editing the Readme, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.
67+
68+
## License
69+
70+
[MIT](LICENSE) © Ian Preston

build.xml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<target name="compile" depends="init" description="compile the source">
2121
<javac includeantruntime="false" srcdir="${src}" destdir="${build}" debug="true" debuglevel="lines,vars,source">
2222
<classpath>
23-
<fileset dir="lib">
23+
<fileset dir="lib">
2424
<include name="**/*.jar" />
2525
</fileset>
2626
</classpath>
@@ -37,28 +37,27 @@
3737
</manifestclasspath>
3838
<jar jarfile="${dist}/multibase.jar" basedir="${build}">
3939
<manifest>
40-
<attribute name="Class-Path" value="${manifest_cp}"/>
40+
<attribute name="Class-Path" value="${manifest_cp}"/>
41+
<attribute name="Implementation-Vendor" value="io.ipfs"/>
42+
<attribute name="Implementation-Title" value="multibase"/>
43+
<attribute name="Implementation-Version" value="1.0.0"/>
4144
</manifest>
4245
</jar>
43-
<copy todir=".">
44-
<fileset file="${dist}/multibase.jar"/>
45-
</copy>
4646
</target>
4747

48-
4948
<target name="test" depends="compile,dist">
5049
<junit printsummary="yes" fork="true" haltonfailure="yes">
5150
<jvmarg value="-Xmx1g"/>
5251
<classpath>
5352
<pathelement location="lib/junit-4.11.jar" />
5453
<pathelement location="lib/hamcrest-core-1.3.jar" />
55-
<pathelement location="multibase.jar" />
54+
<pathelement location="dist/multibase.jar" />
5655
</classpath>
57-
<test name="io.ipfs.api.MultibaseTests" haltonfailure="yes">
56+
<test name="io.ipfs.multibase.MultibaseTest" haltonfailure="yes">
5857
<formatter type="plain"/>
5958
<formatter type="xml"/>
6059
</test>
61-
</junit>
60+
</junit>
6261
</target>
6362

6463
<target name="clean" description="clean up">

pom.xml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<groupId>io.ipfs</groupId>
6+
<artifactId>multibase</artifactId>
7+
<version>1.0.0</version>
8+
<packaging>jar</packaging>
9+
10+
<name>multibase</name>
11+
<url>https://github.com/multiformats/java-multibase</url>
12+
13+
<issueManagement>
14+
<url>https://github.com/multiformats/java-multibase/issues</url>
15+
<system>GitHub Issues</system>
16+
</issueManagement>
17+
18+
<scm>
19+
<url>https://github.com/multiformats/java-multibase</url>
20+
<connection>scm:git:git://github.com/multiformats/java-multibase.git</connection>
21+
<developerConnection>scm:git:[email protected]:multiformats/java-multibase.git</developerConnection>
22+
</scm>
23+
24+
<licenses>
25+
<license>
26+
<name>MIT License</name>
27+
<url>https://github.com/multiformats/java-multiaddr/blob/master/LICENSE</url>
28+
<distribution>repo</distribution>
29+
</license>
30+
</licenses>
31+
32+
<properties>
33+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
34+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
35+
<junit.version>4.12</junit.version>
36+
<hamcrest.version>1.3</hamcrest.version>
37+
</properties>
38+
39+
<dependencies>
40+
<dependency>
41+
<groupId>junit</groupId>
42+
<artifactId>junit</artifactId>
43+
<version>${junit.version}</version>
44+
<scope>test</scope>
45+
</dependency>
46+
<dependency>
47+
<groupId>org.hamcrest</groupId>
48+
<artifactId>hamcrest-core</artifactId>
49+
<version>${hamcrest.version}</version>
50+
<scope>test</scope>
51+
</dependency>
52+
</dependencies>
53+
54+
<build>
55+
<plugins>
56+
<plugin>
57+
<groupId>org.apache.maven.plugins</groupId>
58+
<artifactId>maven-compiler-plugin</artifactId>
59+
<version>3.1</version>
60+
<configuration>
61+
<source>1.8</source>
62+
<target>1.8</target>
63+
</configuration>
64+
</plugin>
65+
<plugin>
66+
<groupId>org.apache.maven.plugins</groupId>
67+
<artifactId>maven-surefire-plugin</artifactId>
68+
<version>2.19.1</version>
69+
</plugin>
70+
<plugin>
71+
<groupId>org.apache.maven.plugins</groupId>
72+
<artifactId>maven-jar-plugin</artifactId>
73+
<version>3.0.2</version>
74+
<configuration>
75+
<archive>
76+
<manifest>
77+
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
78+
</manifest>
79+
</archive>
80+
</configuration>
81+
</plugin>
82+
</plugins>
83+
</build>
84+
</project>

src/test/java/io/ipfs/multibase/MultibaseTests.java renamed to src/test/java/io/ipfs/multibase/MultibaseTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import java.util.*;
66

7-
public class MultibaseTests {
7+
public class MultibaseTest {
88

99
@Test
1010
public void base58Test() {

0 commit comments

Comments
 (0)