@@ -5,9 +5,12 @@ plugins {
55 id " kotlin-android"
66}
77
8- // Edit this line every release
98def releaseVersion = " 1.0.5"
109
10+ // Note: Please, don't edit it if you don't know what it does
11+ def startVersionCode = 2808
12+ def startMillis = 1719658313080
13+
1114def gitCommitHash = providers. exec {
1215 commandLine(" git" , " rev-parse" , " --short" , " HEAD" )
1316}. standardOutput. asText. get(). trim()
@@ -20,19 +23,39 @@ android {
2023 applicationId " com.mrboomdev.awery"
2124 targetSdk 34
2225
23- /* We want to make sure that all build versions across the planet will be in sync */
24- var timezone = TimeZone . getTimeZone(" UTC" )
25- var calendarCurrent = Calendar . getInstance(timezone)
26+ /* Only one version can be published per second or else horrible things will happen.
27+ * After 70 years we'll be required to make Awery 2 because of an integer limit,
28+ * Date receiver from the test below:
29+ *
30+ * 3865053756028 : 2145398250 - Mon Jun 23 15:02:36 YEKT 2092
31+ * 3865747384956 : 2146091879 - Tue Jul 01 15:43:04 YEKT 2092
32+ * 3866441013884 : 2146785508 - Wed Jul 09 16:23:33 YEKT 2092
33+ * 3867134642812 : 2147479137 - Thu Jul 17 17:04:02 YEKT 2092
34+ * 3867828271740 : -2146794530 - Fri Jul 25 17:44:31 YEKT 2092
35+ * */
36+ versionName " $releaseVersion -$gitCommitHash "
37+ versionCode ((startVersionCode + ((System . currentTimeMillis() - startMillis) / 1000 )) as int )
38+
39+ /* long i = System.currentTimeMillis()
40+ var a = new Date(i)
41+ while(true) {
42+ i += (1000 * 60 * 60 * 24 * 356)
43+ a.setTime(i)
2644
27- /* Just a random date to begin with */
28- var calendarBegin = Calendar . getInstance(timezone)
29- calendarBegin. set(2024 , 2 , 4 )
45+ versionCode ((startVersionCode + ((i - startMillis) / 1000)) as int)
3046
31- /* Only one version can be published per hour or else horrible things will happen */
32- var newVersionCodeTimeout = 60 * 60 * 1000
47+ System.out.println("$i : $versionCode - ${a}")
3348
34- versionName " $releaseVersion -$gitCommitHash "
35- versionCode (((calendarCurrent. timeInMillis - calendarBegin. timeInMillis) / newVersionCodeTimeout) as int )
49+ if(versionCode < 0 || versionCode >= Integer.MAX_VALUE) {
50+ throw new IllegalStateException("We've reached the end. Now Awery 2 must be released!" +
51+ " Input: $versionCode : ${a}")
52+ }
53+ }*/
54+
55+ if (versionCode < 0 || versionCode >= Integer . MAX_VALUE ) {
56+ throw new IllegalStateException (" We've reached the end. " +
57+ " Now Awery 2 must be released! Input int: $versionCode " )
58+ }
3659
3760 javaCompileOptions {
3861 annotationProcessorOptions {
@@ -167,19 +190,18 @@ dependencies {
167190 annotationProcessor " androidx.room:room-compiler:$room_version "
168191
169192 // UI
193+ implementation " androidx.core:core-splashscreen:1.0.1"
170194 implementation " androidx.recyclerview:recyclerview:1.3.2"
171195 implementation " androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
172196 implementation " com.google.android.material:material:1.12.0"
173- implementation " nl.joery.animatedbottombar:library:1.1.0"
174- implementation " com.davemorrissey.labs:subsampling-scale-image-view-androidx:3.10.0"
175197 implementation " com.github.VipulOG:ebook-reader:0.1.6"
176198 implementation " com.github.emilaleborn:PageIndicatorView:905cd4e2ab"
177- implementation " androidx.paging:paging-runtime-ktx:3.3.0"
178199 implementation " com.github.skydoves:colorpickerview:2.3.0"
179- implementation " androidx.core:core-splashscreen:1.0.1"
180200 implementation " com.github.skydoves:balloon:1.6.4"
181- implementation " nl.dionsegijn:konfetti-xml:2.0.4 "
201+ implementation " com.davemorrissey.labs:subsampling-scale-image-view-androidx:3.10.0 "
182202 implementation " com.rubensousa.dpadrecyclerview:dpadrecyclerview:1.3.0-alpha04"
203+ implementation " nl.dionsegijn:konfetti-xml:2.0.4"
204+ implementation " nl.joery.animatedbottombar:library:1.1.0"
183205
184206 // Markdown
185207 for (String module_name : List . of(" core" , " editor" , " ext-strikethrough" , " html" , " image" , " image-glide" , " linkify" )) {
@@ -214,8 +236,6 @@ dependencies {
214236 implementation " com.github.inorichi.injekt:injekt-core:65b0440"
215237 implementation " org.jsoup:jsoup:1.15.4"
216238 implementation " com.github.gpanther:java-nat-sort:natural-comparator-1.1"
217- implementation " com.github.tachiyomiorg:unifile:17bec43"
218- implementation " org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version "
219239 implementation " org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlin_serialization_verison "
220240 implementation " org.jetbrains.kotlinx:kotlinx-serialization-json-okio:$kotlin_serialization_verison "
221241 implementation " org.jetbrains.kotlinx:kotlinx-serialization-protobuf:$kotlin_serialization_verison "
0 commit comments