Skip to content

Commit b7d32c4

Browse files
committed
Merge branch 'release/PROD_0.2.0'
2 parents 6ac6f77 + 6691f11 commit b7d32c4

File tree

121 files changed

+5452
-4160
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+5452
-4160
lines changed

app/build.gradle

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,72 @@ android {
99
minSdkVersion 18
1010
targetSdkVersion 21
1111
versionCode 1
12-
versionName "0.1.2"
12+
versionName "0.2.0"
1313
}
1414
buildTypes {
1515
release {
1616
minifyEnabled false
1717
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
1818
}
1919
}
20+
21+
applicationVariants.all { variant ->
22+
variant.outputs.each { output ->
23+
def apk = output.outputFile;
24+
def jenkinsUser = System.getProperty("user.name");
25+
def newName;
26+
if(jenkinsUser == "jenkins") {
27+
newName = "Paragon_${variant.versionName}_${new Date().format("MM-dd-yyyy")}.apk"
28+
}
29+
else {
30+
newName = "Paragon_${variant.versionName}.apk"
31+
}
32+
output.outputFile = new File(apk.parentFile, newName)
33+
}
34+
}
35+
36+
gradle.buildFinished {
37+
moveApkToDeploy(this);
38+
}
39+
40+
}
41+
42+
43+
def moveApkToDeploy(project) {
44+
def srcApkFolder = project.file("build/outputs/apk");
45+
def jenkinsUser = System.getProperty("user.name");
46+
def destPath;
47+
if(jenkinsUser == "jenkins") {
48+
destPath = "/Users/Shared/${System.getProperty("user.name")}/AutoGeneratedFile/Android/${project.parent.name}";
49+
}
50+
else {
51+
destPath = "/Users/${System.getProperty("user.name")}/Desktop/${project.parent.name}";
52+
}
53+
54+
new File(destPath).mkdirs();
55+
56+
File[] listOfFiles = srcApkFolder.listFiles();
57+
if (listOfFiles == null || listOfFiles.size() == 0)
58+
return;
59+
60+
// move
61+
for (File f : listOfFiles) {
62+
if (f.isFile()) {
63+
println "target: ${f.getName()}"
64+
65+
InputStream input = new FileInputStream(f);
66+
OutputStream output = new FileOutputStream(destPath + "/" + f.getName());
67+
68+
byte[] buffer = new byte[1024];
69+
int length;
70+
71+
while ((length = input.read(buffer)) > 0)
72+
output.write(buffer, 0, length);
73+
74+
input.close();
75+
output.close();
76+
}
77+
}
2078
}
2179

2280
repositories {

app/src/main/AndroidManifest.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
android:targetSdkVersion="21" />
88

99
<uses-permission android:name="android.permission.BLUETOOTH" />
10+
<uses-permission android:name="android.permission.INTERNET" />
1011
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
1112

1213
<uses-permission
@@ -19,6 +20,7 @@
1920
android:required="true" />
2021

2122
<application
23+
android:name=".FirstBuildApplication"
2224
android:allowBackup="true"
2325
android:icon="@mipmap/ic_launcher"
2426
android:label="@string/app_name"
@@ -42,7 +44,8 @@
4244
android:name=".paragon.ParagonMainActivity"
4345
android:label="@string/title_activity_paragon_main"
4446
android:windowSoftInputMode="adjustUnspecified|adjustPan"
45-
android:screenOrientation="portrait" >
47+
android:screenOrientation="portrait"
48+
android:parentActivityName="com.firstbuild.androidapp.dashboard.DashboardActivity">
4649
</activity>
4750
<activity
4851
android:name=".addProduct.AddProductActivity"

0 commit comments

Comments
 (0)