1
0
Fork 0
mirror of https://github.com/gsantner/dandelion synced 2024-11-24 21:32:07 +01:00

Update buildscript

This commit is contained in:
Gregor Santner 2018-02-06 23:11:18 +01:00
parent 8aec1aa74f
commit 3442f018e9
No known key found for this signature in database
GPG key ID: 7E83A7834AECB009
4 changed files with 34 additions and 23 deletions

View file

@ -1,17 +1,11 @@
<!-- Hello, and thanks for contributing! -->
Fixes issue #
Proposed changes in this pull request:
-
-
<!--
Hello, and thanks for contributing!
## Contributors document
Add yourself! When adding your information to the `CONTRIBUTORS.md` file, please use the following format:
@ -22,5 +16,4 @@ Where:
* Text: Information about / kind of contribution
Example:
* **[Nice Guy](http://niceguy.web)**<br/>~° German localization
-->

1
.gitignore vendored
View file

@ -96,6 +96,7 @@ app/src/main/res/raw/changelog.*
app/src/main/res/raw/license.*
app/src/main/res/raw/readme.*
app/src/main/res/raw/contributors.*
app/flavor*
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

View file

@ -325,8 +325,16 @@ public class DiasporaStreamFragment extends BrowserFragment {
@SuppressWarnings("unused")
@JavascriptInterface
public void setUserProfile(final String webMessage) throws JSONException {
final DiasporaUserProfile pup = ((App) getActivity().getApplication()).getDiasporaUserProfile();
App app = ((App) getActivity().getApplication());
final DiasporaUserProfile pup = app.getDiasporaUserProfile();
if (pup.isRefreshNeeded()) {
try {
// Try to very fail-safe check if user information gets really loaded from correct pod
if (!webView.getUrl().startsWith(app.getSettings().getPod().getPodUrl().getBaseUrl())) {
return;
}
} catch (Exception ignored) {
}
AppLog.v(this, "DiasporaUserProfile needs refresh; Try to parse JSON");
pup.parseJson(webMessage);
getActivity().runOnUiThread(new Runnable() {

View file

@ -4,18 +4,20 @@ buildscript {
ext.version_setup_compileSdk = 27
ext.version_setup_minSdk = 17
ext.version_setup_targetSdk = ext.version_setup_compileSdk
ext.version_setup_buildTools = "27.0.1" // Specifying optional
ext.version_setup_buildTools = "27.0.3" // Specifying optional
// https://developer.android.com/studio/releases/gradle-plugin.html
ext.version_gradle_tools = "3.0.1"
// https://developer.android.com/topic/libraries/support-library/revisions.html
ext.version_library_appcompat = "27.0.1"
ext.version_library_appcompat = "27.0.2"
// https://github.com/JakeWharton/butterknife/releases
ext.version_library_butterknife = "8.8.1"
// https://github.com/atlassian/commonmark-java/releases
ext.version_library_commonmark = "0.10.0"
// https://github.com/guardianproject/NetCipher/releases
ext.version_library_netcipher = "2.0.0-alpha1"
// https://github.com/JetBrains/kotlin/blob/master/ReadMe.md
ext.version_plugin_kotlin = "1.1.60"
// https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-gradle-plugin#LookAtCentral
ext.version_plugin_kotlin = "1.2.10"
ext.enable_plugin_kotlin = false
repositories {
@ -23,7 +25,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "com.android.tools.build:gradle:$version_gradle_tools"
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
if (project.enable_plugin_kotlin) {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$version_plugin_kotlin"
@ -41,18 +43,22 @@ allprojects {
mavenCentral()
maven { url "https://jitpack.io" }
}
tasks.matching { task -> task.name.matches('.*generate.*Resources') }.all {
task -> task.dependsOn copyRepoFiles
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
final String[] ROOT_TO_RAW_COPYFILES = ["README.md", "CHANGELOG.md", "CONTRIBUTORS.md","LICENSE.txt","LICENSE.md","LICENSE"]
final String[] ROOT_TO_RAW_COPYFILES = ["README.md", "CHANGELOG.md", "CONTRIBUTORS.md", "LICENSE.txt", "LICENSE.md", "LICENSE"]
task copyRepoFiles(type: Copy) {
from rootProject.files(ROOT_TO_RAW_COPYFILES)
into "app/src/main/res/raw"
rename { String fileName -> fileName.replace(fileName, fileName.toLowerCase()) }
}; tasks.copyRepoFiles.execute()
}
@SuppressWarnings(["UnnecessaryQualifiedReference", "SpellCheckingInspection", "GroovyUnusedDeclaration"])
@ -73,10 +79,13 @@ static String getUsedAndroidLanguages() {
}
ext.getGitHash = { ->
def stdout = new ByteArrayOutputStream()
exec {
try {
def stdout = new ByteArrayOutputStream() exec {
commandLine 'git', 'rev-parse', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
} catch (Exception e) {
return '???'
}
}