GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — - introduce better approach to specify the signing.gradle · max2max4u/AboutLibraries@9c0c0f0

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .github/workflows
    • ci.yml
  • app
    • build.gradle
  • build.gradle
  • configurations.gradle
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/workflows/ci.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/ci.yml
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
name: CI
44
on:
5-
push:
65
pull_request:
76
jobs:
87
ci:
Collapse file

‎app/build.gradle‎

Copy file name to clipboardExpand all lines: app/build.gradle
+4-8Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ apply plugin: 'kotlin-android'
33
apply plugin: 'kotlin-android-extensions'
44
apply plugin: 'com.mikepenz.aboutlibraries.plugin'
55

6-
//wrap with try and catch so the build is working even if the signing stuff is missing
7-
try {
8-
apply from: '../../../signing.gradle'
9-
} catch (ignored) {
6+
if (getSigningFile() != null) {
7+
apply from: "${getSigningFile()}"
108
}
119

1210
android {
@@ -33,17 +31,15 @@ android {
3331
minifyEnabled false
3432
}
3533
release {
36-
try {
34+
if (getSigningFile() != null) {
3735
signingConfig signingConfigs.release
38-
} catch (ignored) {
3936
}
4037
zipAlignEnabled true
4138
minifyEnabled false
4239
}
4340
staging {
44-
try {
41+
if (getSigningFile() != null) {
4542
signingConfig signingConfigs.release
46-
} catch (ignored) {
4743
}
4844
applicationIdSuffix ".debugStaging"
4945
matchingFallbacks = ['debug']
Collapse file

‎build.gradle‎

Copy file name to clipboardExpand all lines: build.gradle
+7-5Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
buildscript {
2+
apply from: 'configurations.gradle'
3+
24
ext {
35
release = [
46
versionName: "8.3.1",
@@ -17,14 +19,14 @@ buildscript {
1719
cardview : '1.0.0',
1820
appcompat : '1.2.0',
1921
recyclerview : '1.1.0',
20-
material : '1.2.0',
22+
material : '1.2.1',
2123
kotlin : "1.4.10",
2224
constraintLayout: '2.0.1',
2325
iconics : "5.0.3",
24-
detekt : '1.0.1',
25-
fastadapter : "5.1.0",
26-
materialdrawer : "8.1.0",
27-
coreKtx : "1.3.1"
26+
detekt : '1.12.0',
27+
fastadapter : "5.2.3",
28+
materialdrawer : "8.1.5",
29+
coreKtx : "1.3.2"
2830
]
2931
}
3032

Collapse file

‎configurations.gradle‎

Copy file name to clipboard
+116Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
/*
2+
* Copyright (C) 2020 Mike Penz
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
import java.text.SimpleDateFormat
17+
18+
/**
19+
* retrieves a value from the local properties
20+
*/
21+
ext.getLocalProps = {
22+
Properties localProperties = new Properties()
23+
localProperties.load(new File('local.properties').newDataInputStream())
24+
return localProperties
25+
}
26+
27+
/**
28+
* helper method to retrieve a value either from a local property, or via the global defined properties
29+
*/
30+
ext.getLocalOrGlobalProperty = { key ->
31+
try {
32+
def val = getLocalProps().getProperty("$key")
33+
if (val == null) {
34+
val = getProperty("$key")
35+
}
36+
return val
37+
} catch (ignored) {
38+
return null
39+
}
40+
}
41+
42+
/**
43+
* retrieves a value from the properties or falls back to the default
44+
*/
45+
ext.getProperyOrDefault = { key, defau ->
46+
def val = null
47+
try {
48+
val = project.hasProperty(key) ? project.getProperty(key) : null
49+
} catch (Exception ex) {
50+
}
51+
if (val != null && !val.toString().equals("")) {
52+
return val
53+
}
54+
val = getLocalOrGlobalProperty(key)
55+
if (val == null || val.toString().equals("")) {
56+
return defau
57+
} else {
58+
return val
59+
}
60+
}
61+
62+
/**
63+
* used to sign the app in release mode
64+
* Further information can be found in the README.md
65+
*/
66+
ext.getSigningFile = {
67+
return getLocalOrGlobalProperty("openSource.signing.file")
68+
}
69+
70+
/**
71+
* retrieves the current git hash
72+
*/
73+
ext.gitHash = { ->
74+
try {
75+
def outstream = new ByteArrayOutputStream()
76+
exec {
77+
commandLine 'git', 'rev-parse', '--short', 'HEAD'
78+
standardOutput = outstream
79+
}
80+
return outstream.toString().trim()
81+
} catch (Exception ex) {
82+
logger.warn('The build was not able to resolve the git branch, this project seems to be not within a git project')
83+
return ""
84+
}
85+
}
86+
87+
/**
88+
* retrieves the current git branch
89+
*/
90+
ext.gitBranch = { ->
91+
try {
92+
def outstream = new ByteArrayOutputStream()
93+
exec {
94+
commandLine 'git', 'name-rev', '--name-only', 'HEAD'
95+
standardOutput = outstream
96+
}
97+
return outstream.toString().trim()
98+
} catch (Exception ex) {
99+
logger.warn('The build was not able to resolve the git branch, this project seems to be not within a git project')
100+
return ""
101+
}
102+
}
103+
104+
/**
105+
* retrieves the current timestamp during the build
106+
*/
107+
ext.buildDate = { ->
108+
return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm").format(new Date())
109+
}
110+
111+
/**
112+
* Checks if this build is from an IDE
113+
*/
114+
ext.isIdeBuild = { ->
115+
return project.properties['android.injected.invoked.from.ide'] == 'true'
116+
}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.