Skip to content

Commit

Permalink
v0.2.0a
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregor Santner committed Nov 7, 2016
1 parent bea3529 commit fff3c7a
Show file tree
Hide file tree
Showing 17 changed files with 1,043 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ app/src/main/res/raw/contributors.md
app/src/main/res/raw/license.md
app/src/main/res/raw/readme.md
app/src/main/res/raw/contributors.txt
app/src/main/res/raw/podlist.json
#app/src/main/res/raw/podlist.json

##############
### Common ###
Expand Down
24 changes: 1 addition & 23 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {
minSdkVersion 17
targetSdkVersion 24
versionCode 10
versionName "0.2.0-next"
versionName "0.2.0a"
setProperty("archivesBaseName", "diasporaAndroid__${versionName}__")

vectorDrawables.useSupportLibrary = true
Expand Down Expand Up @@ -61,8 +61,6 @@ dependencies {
// #####################
final String RAW_DIR = "app/src/main/res/raw"
final String[] ROOT_TO_RAW_COPYFILES = ["README.md", "LICENSE.md", "CHANGELOG.md", "CONTRIBUTORS.txt"]
final String PODLIST_URL = 'https://raw.githubusercontent.com/Diaspora-for-Android/diaspora-android-extras/master/podList/podlist.json'
final String PODLIST_PATH = "${RAW_DIR}/podlist.json"

// Called before building
task copyRepoFiles(type: Copy) {
Expand All @@ -84,26 +82,6 @@ task copyRepoFiles(type: Copy) {
(line.toString().matches("..l>>.*") || line.toString().startsWith("## 99l CONTRIBUTORS")) ? null : line.toString().trim().replaceAll(" \\(.*\\)", "")
}
}

// Download PodList
downloadFile(PODLIST_PATH, PODLIST_URL, false)

// Application variants
android.applicationVariants.all { v ->
// Do if we build in release (signed apk) mode
if (v.buildType.name == "release") {
downloadFile(PODLIST_PATH, PODLIST_URL, true)
}
}
}

// Downloads a file
def downloadFile(filePath, url, downloadIfExists) {
def f = new File(filePath)
f.exists() && downloadIfExists && f.delete();
if (!f.exists()) {
new URL(url).withInputStream { i -> f.withOutputStream { it << i } }
}
}

tasks.copyRepoFiles.execute()
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
public class FetchPodsService extends Service {
public static final String EXTRA_PODLIST = "pods";
public static final String MESSAGE_PODS_RECEIVED = "com.github.dfa.diaspora.podsreceived";
public static final String PODDY_PODLIST_URL = "https://raw.githubusercontent.com/Diaspora-for-Android/diaspora-android-extras/master/podList/podlist.json";
public static final String PODDY_PODLIST_URL = "https://raw.githubusercontent.com/Diaspora-for-Android/diaspora-android/master/app/src/main/res/raw/podlist.json";

public FetchPodsService() {
}
Expand Down
Loading

0 comments on commit fff3c7a

Please sign in to comment.