Skip to content

Commit e5303b3

Browse files
committed
Merge pull request #2 from studyplus/abolish-local-maven
Abolish local maven
2 parents 3954fe9 + aadf237 commit e5303b3

File tree

7 files changed

+74
-14
lines changed

7 files changed

+74
-14
lines changed

SDKExample/src/main/java/jp/studyplus/android/sdk/example/ExampleActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public void onClick(View v) {
6868
}
6969
}
7070

71-
@Subscribe
71+
@Subscribe @SuppressWarnings("unused")
7272
public void showMessage(SuccessfulResponse response){
7373
Toast.makeText(context, "投稿完了!", Toast.LENGTH_SHORT).show();
7474
}

StudyplusAndroidSDK/build.gradle

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,8 @@ dependencies {
3434
forTesting.each{ instrumentTestCompile it }
3535
}
3636

37-
apply plugin: 'maven'
38-
39-
uploadArchives {
40-
repositories {
41-
mavenDeployer {
42-
repository(url: "file://" + new File(rootDir, "repository"))
43-
pom.version = "1.0.0"
44-
pom.groupId = 'jp.studyplus.android.sdk'
45-
pom.artifactId = "studyplus-android-sdk"
46-
}
47-
}
37+
if (gradle.startParameter.taskNames.contains('uploadArchives')) {
38+
apply from: 'gradle/build.publish.gradle'
4839
}
4940

5041
android.libraryVariants.all { variant ->
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
signing.keyId=__your_value__
2+
signing.password=__your_value__
3+
signing.secretKeyRingFile=__your_value__
4+
5+
sonatypeUsername=__your_value__
6+
sonatypePassword=__your_value__
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
apply plugin: 'maven'
2+
apply plugin: 'signing'
3+
4+
signing {
5+
sign configurations.archives
6+
}
7+
8+
uploadArchives {
9+
repositories {
10+
mavenDeployer {
11+
beforeDeployment {
12+
MavenDeployment deployment -> signing.signPom(deployment)
13+
}
14+
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
15+
authentication(
16+
userName: project.properties.sonatypeUsername,
17+
password: project.properties.sonatypePassword)
18+
}
19+
pom.version = "1.0.2"
20+
pom.groupId = 'jp.studyplus.android.sdk'
21+
pom.artifactId = "studyplus-android-sdk"
22+
pom.project {
23+
name 'Studyplus Android SDK'
24+
packaging 'aar'
25+
description 'Studyplus SDK for Android'
26+
url 'https://github.com/studyplus/Studyplus-Android-SDK'
27+
scm {
28+
def location = 'scm:[email protected]:studyplus/Studyplus-Android-SDK.git'
29+
url location
30+
connection location
31+
developerConnection location
32+
}
33+
licenses {
34+
license {
35+
name 'MIT License'
36+
url 'http://opensource.org/licenses/MIT'
37+
distribution 'repo'
38+
}
39+
}
40+
developers {
41+
developer {
42+
id 'x7c1'
43+
name 'haco'
44+
}
45+
}
46+
}
47+
}
48+
}
49+
}

StudyplusAndroidSDK/src/main/java/jp/studyplus/android/sdk/service/studyrecord/StudyRecordBuilder.java

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

55
import java.text.SimpleDateFormat;
66
import java.util.Date;
7+
import java.util.Locale;
78

89
public class StudyRecordBuilder {
910

@@ -33,7 +34,7 @@ public StudyRecordBuilder setDurationSeconds(int seconds){
3334
}
3435

3536
public StudyRecordBuilder setRecordedTime(Date date){
36-
String time = new SimpleDateFormat("yyyy'-'MM'-'dd' 'HH':'mm':'ss").format(date);
37+
String time = new SimpleDateFormat("yyyy'-'MM'-'dd' 'HH':'mm':'ss", Locale.US).format(date);
3738
this.recordedTime = Optional.of(time);
3839
return this;
3940
}

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
}
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:0.8.+'
10+
classpath 'com.android.tools.build:gradle:0.8.3'
1111
classpath 'com.squareup.gradle:gradle-android-test-plugin:0.9.1-SNAPSHOT'
1212
}
1313
}

settings.gradle

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
11
include ':StudyplusAndroidSDK', ':SDKExample'
2+
3+
def setupDefaultProperties = { project ->
4+
String dir = project.projectDir.absolutePath
5+
def properties = new File(dir, "gradle.properties")
6+
def example = new File(properties.getAbsolutePath() + ".example")
7+
def notFound = !properties.exists() && example.exists()
8+
if (notFound){
9+
properties << example.readBytes()
10+
}
11+
}
12+
[':StudyplusAndroidSDK', ':SDKExample'].each{
13+
setupDefaultProperties project(it)
14+
}

0 commit comments

Comments
 (0)