Skip to content

Commit c09067f

Browse files
Merge pull request #7 from starkbank/refactor/deploy-info
Refactor/deploy info
2 parents 568ab7c + b6423d8 commit c09067f

File tree

16 files changed

+484
-209
lines changed

16 files changed

+484
-209
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,4 @@ message.txt
7474
publicKey.pem
7575
privateKey.pem
7676
signatureBinary.txt
77+
gradle.properties

build.gradle

Lines changed: 87 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,106 @@
1-
/*
2-
* This file was generated by the Gradle 'init' task.
3-
*
4-
* This is a general purpose Gradle build.
5-
* Learn how to create Gradle builds at https://guides.gradle.org/creating-new-gradle-builds/
6-
*/
7-
buildscript {
8-
repositories {
9-
jcenter()
10-
//Add only for SNAPSHOT versions
11-
//maven { url "http://oss.sonatype.org/content/repositories/snapshots/" }
12-
}
13-
dependencies {
14-
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.11.0"
15-
}
16-
}
17-
181
plugins {
192
id 'java'
20-
id 'maven'
21-
id 'maven-publish'
22-
id 'com.github.kt3k.coveralls' version '2.8.2'
233
}
244

5+
group 'com.starkbank.ellipticcurve'
6+
version '1.0.0'
7+
258
sourceCompatibility = 1.7
26-
targetCompatibility = 1.7
279

28-
group = GROUP
29-
version = VERSION_NAME
10+
repositories {
11+
mavenCentral()
12+
}
13+
dependencies {
14+
testCompile group: 'junit', name: 'junit', version: '4.12'
15+
testCompile group: 'org.mockito', name: 'mockito-core', version: '2.22.0'
16+
}
3017

18+
apply plugin: 'maven'
19+
apply plugin: 'signing'
3120

32-
tasks.withType(JavaCompile) {
33-
options.compilerArgs << "-Xlint:all" << "-Xlint:-options" << "-Xlint:-processing"
34-
options.encoding = 'UTF-8'
35-
}
21+
archivesBaseName = "starkbank-ecdsa"
3622

37-
configurations.all {
23+
24+
task javadocJar(type: Jar) {
25+
classifier = 'javadoc'
26+
from javadoc
3827
}
3928

40-
repositories {
41-
jcenter()
29+
task sourcesJar(type: Jar) {
30+
classifier = 'sources'
31+
from sourceSets.main.allSource
4232
}
4333

44-
dependencies {
45-
testCompile group: 'junit', name: 'junit', version: '4.12'
46-
testCompile group: 'org.mockito', name: 'mockito-core', version: '2.22.0'
34+
artifacts {
35+
archives javadocJar, sourcesJar
4736
}
4837

49-
jar {
50-
manifest {
51-
attributes("Implementation-Title": POM_NAME,
52-
"Implementation-Version": VERSION_NAME,
53-
"Implementation-Vendor": VENDOR_NAME)
54-
}
38+
signing {
39+
sign configurations.archives
5540
}
56-
//Uncomment after setting up maven central account
57-
//apply from: 'deploy.gradle'
5841

59-
test {
60-
testLogging {
61-
events "passed", "skipped", "failed"
62-
exceptionFormat "full"
42+
uploadArchives {
43+
repositories {
44+
mavenDeployer {
45+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
46+
47+
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
48+
authentication(
49+
userName: project.hasProperty('ossrhUsername') ? project.property('ossrhUsername') : 'username',
50+
password: project.hasProperty('ossrhPassword') ? project.property('ossrhPassword') : 'password'
51+
)
52+
}
53+
54+
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
55+
authentication(
56+
userName: project.hasProperty('ossrhUsername') ? project.property('ossrhUsername') : 'username',
57+
password: project.hasProperty('ossrhPassword') ? project.property('ossrhPassword') : 'password'
58+
)
59+
}
60+
61+
pom.project {
62+
name 'StarkBank SDK Java'
63+
packaging 'jar'
64+
// optionally artifactId can be defined here
65+
description 'SDK to facilitate Java integrations with the Stark Bank API'
66+
url 'https://github.com/starkbank/sdk-java'
67+
68+
scm {
69+
connection 'scm:git:git://github.com/starkbank/sdk-java.git'
70+
developerConnection 'scm:git:ssh://github.com/starkbank/sdk-java.git'
71+
url 'https://github.com/starkbank/sdk-java/'
72+
}
73+
74+
licenses {
75+
license {
76+
name 'MIT License'
77+
url 'https://github.com/starkbank/sdk-java/blob/master/LICENSE'
78+
}
79+
}
80+
81+
developers {
82+
developer {
83+
id 'rcmstark'
84+
name 'Rafael Stark'
85+
86+
}
87+
developer {
88+
id 'daltonmenezes'
89+
name 'Dalton Menezes'
90+
91+
}
92+
developer {
93+
id 'cdottori'
94+
name 'Caio Dottori'
95+
96+
}
97+
developer {
98+
id 'thalesmello'
99+
name 'Thales Mello'
100+
101+
}
102+
}
103+
}
104+
}
63105
}
64106
}

deploy.gradle

Lines changed: 0 additions & 121 deletions
This file was deleted.

gradle.properties

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/main/java/com/starkbank/ellipticcurve/Curve.java

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ public class Curve {
1818
public String name;
1919
public long[] oid;
2020

21+
/**
22+
*
23+
* @param A
24+
* @param B
25+
* @param P
26+
* @param N
27+
* @param Gx
28+
* @param Gy
29+
* @param name
30+
* @param oid
31+
*/
2132
public Curve(BigInteger A, BigInteger B, BigInteger P, BigInteger N, BigInteger Gx, BigInteger Gy, String name, long[] oid) {
2233
this.A = A;
2334
this.B = B;
@@ -38,10 +49,17 @@ public boolean contains(Point p) {
3849
return p.y.pow(2).subtract(p.x.pow(3).add(A.multiply(p.x)).add(B)).mod(P).intValue() == 0;
3950
}
4051

52+
/**
53+
*
54+
* @return
55+
*/
4156
public int length() {
4257
return (1 + N.toString(16).length()) / 2;
4358
}
4459

60+
/**
61+
*
62+
*/
4563
public static final Curve secp256k1 = new Curve(
4664
BigInteger.ZERO,
4765
BigInteger.valueOf(7),
@@ -53,10 +71,14 @@ public int length() {
5371
new long[]{1, 3, 132, 0, 10}
5472
);
5573

56-
//List<Curve>
74+
/**
75+
*
76+
*/
5777
public static final List supportedCurves = new ArrayList();
5878

59-
// Map<BigInteger[], Curve>
79+
/**
80+
*
81+
*/
6082
public static final Map curvesByOid = new HashMap();
6183

6284
static {

0 commit comments

Comments
 (0)