Compare commits

..

No commits in common. '17099fc3e61ec8dbd38c6cad8c4e41c073290211' and '21d900c917a6a1ae146397c176b8022d8214bbd7' have entirely different histories.

@ -24,8 +24,8 @@ android {
applicationId "com.cyb3rko.techniklogger"
minSdk 19
targetSdk 33
versionCode 17
versionName '2.2.3'
versionCode 16
versionName "2.2.2"
}
buildTypes {
@ -55,21 +55,21 @@ android {
}
dependencies {
implementation platform('com.google.firebase:firebase-bom:31.4.0')
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation platform('com.google.firebase:firebase-bom:30.0.1')
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.3'
implementation 'androidx.navigation:navigation-ui-ktx:2.5.3'
implementation 'androidx.recyclerview:recyclerview:1.3.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.2'
implementation 'androidx.navigation:navigation-ui-ktx:2.5.2'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'com.afollestad.material-dialogs:bottomsheets:3.3.0'
implementation 'com.airbnb.android:lottie:5.2.0'
implementation 'com.airbnb.android:lottie:4.0.0'
implementation 'com.amitshekhar.android:android-networking:1.0.2'
implementation 'com.github.GrenderG:Toasty:1.5.2'
implementation 'com.github.GrenderG:Toasty:1.5.0'
implementation 'com.github.parse-community.Parse-SDK-Android:parse:1.26.0'
implementation 'com.google.android.material:material:1.8.0'
implementation 'com.google.android.material:material:1.6.1'
implementation 'com.google.firebase:firebase-analytics-ktx' // BOM versioning
implementation 'com.google.firebase:firebase-crashlytics-ktx' // BOM versioning
implementation 'com.itextpdf:itextpdf:5.5.13.3'
implementation 'com.itextpdf:itextpdf:5.5.13.2'
}

@ -1,16 +1,16 @@
package com.cyb3rko.techniklogger.data
internal data class HourMinute(
val hours: Int,
val minutes: Int
data class HourMinute(
internal val hours: Int,
internal val minutes: Int
) {
private val millis = hours.toLong() * 3600000 + minutes.toLong() * 60000
internal val millis = hours.toLong() * 3600000 + minutes.toLong() * 60000
override fun toString(): String {
return "${hours.toTwoDigitString()}:${minutes.toTwoDigitString()}"
return "${hours.toPrettyString()}:${minutes.toPrettyString()}"
}
private fun Int.toTwoDigitString(): String {
private fun Int.toPrettyString(): String {
val intString = this.toString()
return if (intString.length != 1) {
intString
@ -19,24 +19,8 @@ internal data class HourMinute(
}
}
fun hoursUntil(b: HourMinute): Float {
var difference = (b.millis - millis)
if (difference < 0) difference += 86400000
return difference / 3600000f
}
operator fun compareTo(b: HourMinute): Int {
return if (this.hours == b.hours && this.minutes == b.minutes) {
0
} else if (this.hours == b.hours && this.minutes < b.minutes) {
-1
} else if (this.hours < b.hours) {
-1
} else 1
}
companion object {
fun fromString(hourMinute: String): HourMinute {
internal fun fromString(hourMinute: String): HourMinute {
val parts = hourMinute.split(":")
val hours = parts[0].toInt()
val minutes = parts[1].toInt()
@ -44,3 +28,13 @@ internal data class HourMinute(
}
}
}
internal operator fun HourMinute.compareTo(b: HourMinute): Int {
return if (this.hours == b.hours && this.minutes == b.minutes) {
0
} else if (this.hours == b.hours && this.minutes < b.minutes) {
-1
} else if (this.hours < b.hours) {
-1
} else 1
}

@ -8,7 +8,8 @@ import com.parse.ParseException
import com.parse.ParseObject
import com.parse.ParseQuery
internal object ParseController {
object ParseController {
private inline fun <reified T : ParseObject>getQuery(
allowCache: Boolean = true
): ParseQuery<T> {
@ -22,7 +23,7 @@ internal object ParseController {
}
}
fun fetchAdminStatus(
internal fun fetchAdminStatus(
name: String?,
action: (objectId: String?, admin: Boolean?, e: ParseException?) -> Unit
) {
@ -40,7 +41,7 @@ internal object ParseController {
}
}
fun fetchYears(action: (entries: List<Year>, e: ParseException?) -> Unit) {
internal fun fetchYears(action: (entries: List<Year>, e: ParseException?) -> Unit) {
val query = getQuery<Year>()
query.orderByDescending(Year.COLUMN_NAME)
query.selectKeys(listOf(
@ -53,7 +54,10 @@ internal object ParseController {
}
}
fun fetchMission(objectId: String?, action: (mission: Mission?, e: ParseException?) -> Unit) {
internal fun fetchMission(
objectId: String?,
action: (mission: Mission?, e: ParseException?) -> Unit
) {
val query = getQuery<Mission>()
query.selectKeys(listOf(
Mission.COLUMN_DATE,
@ -70,7 +74,10 @@ internal object ParseController {
}
}
fun fetchMissions(year: String, action: (missions: List<Mission>, e: ParseException?) -> Unit) {
internal fun fetchMissions(
year: String,
action: (missions: List<Mission>, e: ParseException?) -> Unit
) {
val query = getQuery<Mission>()
query.whereEqualTo(Mission.COLUMN_YEAR, Year.emptyObject(year))
query.orderByDescending(Mission.COLUMN_DATE)
@ -89,7 +96,7 @@ internal object ParseController {
}
}
fun fetchParticipations(
internal fun fetchParticipations(
missionId: String,
includeMember: Boolean,
action: (participations: List<Participation>, e: ParseException?) -> Unit
@ -117,7 +124,7 @@ internal object ParseController {
}
}
fun fetchMembers(
internal fun fetchMembers(
includeInformation: Boolean,
action: (
members: List<Member>,

@ -6,32 +6,32 @@ import com.parse.ParseObject
@ParseClassName(CLASS_NAME)
internal class Member : ParseObject() {
val admin
internal val admin
get() = getBoolean(COLUMN_ADMIN)
val name
internal val name
get() = getString(COLUMN_NAME)!!
fun setAdmin(admin: Boolean) {
internal fun setAdmin(admin: Boolean) {
put(COLUMN_ADMIN, admin)
}
fun setName(name: String) {
internal fun setName(name: String) {
put(COLUMN_NAME, name)
}
fun retire() {
internal fun retire() {
put(COLUMN_RETIRED, true)
}
companion object {
const val CLASS_NAME = "Techniker"
internal const val CLASS_NAME = "Techniker"
const val COLUMN_ADMIN = "admin"
const val COLUMN_NAME = "name"
const val COLUMN_RETIRED = "entlassen"
internal const val COLUMN_ADMIN = "admin"
internal const val COLUMN_NAME = "name"
internal const val COLUMN_RETIRED = "entlassen"
fun emptyObject(objectId: String): Member {
internal fun emptyObject(objectId: String): Member {
return createWithoutData(Member::class.java, objectId)
}
}

@ -8,57 +8,57 @@ import java.util.*
@ParseClassName(CLASS_NAME)
internal class Mission : ParseObject() {
val date: () -> Date
internal val date: () -> Date
get() = {
val dates = getString(COLUMN_DATE)!!.split(",")
SimpleDateFormat("yyyy.MM.dd", Locale.GERMANY).parse(dates[0])!!
}
val duration
internal val duration
get() = getDouble(COLUMN_DURATION).toFloat()
val location
internal val location
get() = getString(COLUMN_LOCATION)!!
val name
internal val name
get() = getString(COLUMN_NAME)!!
val time: () -> String
internal val time: () -> String
get() = {
val dates = getString(COLUMN_DATE)!!.split(",")
if (dates.size > 1) dates[1] else ""
}
fun setDate(date: String) {
internal fun setDate(date: String) {
put(COLUMN_DATE, date)
}
fun setDuration(duration: Float) {
internal fun setDuration(duration: Float) {
put(COLUMN_DURATION, duration)
}
fun setLocation(location: String) {
internal fun setLocation(location: String) {
put(COLUMN_LOCATION, location)
}
fun setName(name: String) {
internal fun setName(name: String) {
put(COLUMN_NAME, name)
}
fun setYear(yearId: String) {
internal fun setYear(yearId: String) {
put(COLUMN_YEAR, Year.emptyObject(yearId))
}
companion object {
const val CLASS_NAME = "Einsatz"
internal const val CLASS_NAME = "Einsatz"
const val COLUMN_DATE = "datum"
const val COLUMN_DURATION = "dauer"
const val COLUMN_LOCATION = "ort"
const val COLUMN_NAME = "name"
const val COLUMN_YEAR = "jahr"
internal const val COLUMN_DATE = "datum"
internal const val COLUMN_DURATION = "dauer"
internal const val COLUMN_LOCATION = "ort"
internal const val COLUMN_NAME = "name"
internal const val COLUMN_YEAR = "jahr"
fun emptyObject(objectId: String): Mission {
internal fun emptyObject(objectId: String): Mission {
return createWithoutData(Mission::class.java, objectId)
}
}

@ -6,38 +6,38 @@ import com.parse.ParseObject
@ParseClassName(CLASS_NAME)
internal class Participation : ParseObject() {
val by
internal val by
get() = getParseObject(COLUMN_BY)?.objectId
val duration
internal val duration
get() = getDouble(COLUMN_DURATION).toFloat()
val `in`
internal val `in`
get() = getParseObject(COLUMN_IN)?.objectId
val name
internal val name
get() = (getParseObject(COLUMN_BY) as Member).name
val time
internal val time
get() = getString(COLUMN_TIME)!!
fun setDuration(duration: Float) {
internal fun setDuration(duration: Float) {
put(COLUMN_DURATION, duration)
}
fun setTime(time: String) {
internal fun setTime(time: String) {
put(COLUMN_TIME, time)
}
companion object {
const val CLASS_NAME = "Teilnahme"
internal const val CLASS_NAME = "Teilnahme"
const val COLUMN_BY = "von"
const val COLUMN_DURATION = "dauer"
const val COLUMN_IN = "an"
const val COLUMN_TIME = "uhrzeit"
internal const val COLUMN_BY = "von"
internal const val COLUMN_DURATION = "dauer"
internal const val COLUMN_IN = "an"
internal const val COLUMN_TIME = "uhrzeit"
fun emptyObject(objectId: String): Participation {
internal fun emptyObject(objectId: String): Participation {
return createWithoutData(Participation::class.java, objectId)
}
}

@ -6,15 +6,15 @@ import com.parse.ParseObject
@ParseClassName(CLASS_NAME)
internal class Year : ParseObject() {
val name
internal val name
get() = getString(COLUMN_NAME)!!
companion object {
const val CLASS_NAME = "Jahr"
internal const val CLASS_NAME = "Jahr"
const val COLUMN_NAME = "name"
internal const val COLUMN_NAME = "name"
fun emptyObject(objectId: String): Year {
internal fun emptyObject(objectId: String): Year {
return createWithoutData(Year::class.java, objectId)
}
}

@ -108,7 +108,7 @@ class ListingFragment : Fragment() {
closeFABMenu()
}
if (adminMode == null && Safe.getKey(myContext, NAME).isNotEmpty()) {
if (adminMode == null && Safe.getKey(myContext, NAME) != "") {
updateAdminStatus()
} else if (adminMode != null && adminMode!!) {
binding.fabContainer.show()

@ -52,11 +52,11 @@ class MissionPusherFragment : Fragment() {
val timePickerBuilder = TimePickerBuilder()
binding.dateButton.setOnClickListener {
if (date.isNotEmpty()) {
if (date != "") {
datePickerBuilder.setInitialDate(date)
}
if (time.isNotEmpty()) {
if (time != "") {
val times = time.split(" Uhr")[0].split(" - ")
timePickerBuilder.apply {
initialStart = HourMinute.fromString(times[0])
@ -78,7 +78,7 @@ class MissionPusherFragment : Fragment() {
}
}
if (childKey.isNotEmpty()) {
if (childKey != "") {
binding.deleteButton.show()
binding.deleteButton.setOnClickListener {
MaterialAlertDialogBuilder(myContext)
@ -114,12 +114,12 @@ class MissionPusherFragment : Fragment() {
val name = binding.nameEditText.text.toString().trim()
val location = binding.locationEditText.text.toString().trim()
if (name.isNotEmpty() && location.isNotEmpty() && time.isNotEmpty()) {
if (name != "" && location != "" && time != "") {
mission.setName(name)
mission.setLocation(location)
val dateTimes = date.split(".")
var dateTime = "${dateTimes[2]}.${dateTimes[1]}.${dateTimes[0]}"
if (time.isNotEmpty()) dateTime += ",$time"
if (time != "") dateTime += ",$time"
mission.setDate(dateTime)
mission.setDuration(duration)
mission.setYear(Safe.getKey(myContext, CURRENT_YEAR))
@ -150,25 +150,25 @@ class MissionPusherFragment : Fragment() {
}
private fun restoreInformation() {
if (name.isNotEmpty()) {
if (name != "") {
binding.nameEditText.text = SpannableStringBuilder(name)
}
if (location.isNotEmpty()) {
if (location != "") {
binding.locationEditText.text = SpannableStringBuilder(location)
}
if (date.isNotEmpty()) {
if (date != "") {
binding.dateView.text = Html.fromHtml("<b>Datum:</b><br/>${date}")
}
if (time.isNotEmpty()) {
if (time != "") {
binding.durationView.text = Html.fromHtml("<b>Dauer:</b> $time Uhr, $duration Stunden")
} else {
binding.durationView.text = Html.fromHtml("<b>Dauer:</b> $duration Stunden")
}
mission = if (childKey.isEmpty()) {
Mission()
if (childKey == "") {
mission = Mission()
} else {
Mission.emptyObject(childKey)
mission = Mission.emptyObject(childKey)
}
}
}

@ -83,7 +83,7 @@ class YearsFragment : Fragment() {
.show()
}
if (adminMode == null && Safe.getKey(myContext, NAME).isNotEmpty()) {
if (adminMode == null && Safe.getKey(myContext, NAME) != "") {
updateAdminStatus()
} else if (adminMode != null && adminMode!!) {
binding.fab.show()

@ -2,6 +2,7 @@ package com.cyb3rko.techniklogger.modals
import androidx.fragment.app.FragmentActivity
import com.cyb3rko.techniklogger.data.HourMinute
import com.cyb3rko.techniklogger.data.compareTo
import com.cyb3rko.techniklogger.showWarningToast
import com.google.android.material.timepicker.MaterialTimePicker
import com.google.android.material.timepicker.TimeFormat
@ -14,10 +15,10 @@ internal class TimePickerBuilder {
private const val TAG = "TimePickerDialog"
}
var initialStart = HourMinute(0, 0)
var initialEnd = HourMinute(0, 0)
internal var initialStart = HourMinute(0, 0)
internal var initialEnd = HourMinute(0, 0)
fun show(
internal fun show(
activity: FragmentActivity,
missionTime: String?,
action: (time: String, duration: Float) -> Unit
@ -51,7 +52,7 @@ internal class TimePickerBuilder {
missionEnd = HourMinute.fromString(missionTimes[1])
}
lateinit var start: HourMinute
var start = HourMinute(0, 0)
picker1.addOnPositiveButtonClickListener {
start = HourMinute(picker1.hour, picker1.minute)
if (missionStart != null && start < missionStart) {
@ -66,12 +67,13 @@ internal class TimePickerBuilder {
end = HourMinute(picker2.hour, picker2.minute)
if (missionEnd != null && end > missionEnd) {
activity.showWarningToast("Ende muss im Einsatz-Zeitraum liegen")
} else if (start == end) {
} else if (start >= end) {
activity.showWarningToast("Ungültige Arbeitszeit erkannt")
} else {
val time = "$start - $end"
val duration = ((end.millis - start.millis).toFloat() / 3600000f)
val floatFormat = DecimalFormat("#.#", DecimalFormatSymbols(Locale.ENGLISH))
val roundedDuration = floatFormat.format(start.hoursUntil(end))
val roundedDuration = floatFormat.format(duration)
action(time, roundedDuration.toFloat())
}
}

@ -11,18 +11,18 @@
android:id="@+id/loading_animation"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_marginTop="30dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/swipe_refresh_layout"
android:layout_marginTop="30dp"
app:lottie_fileName="loading.json"
app:lottie_loop="true"
app:lottie_speed="1.5" />
app:lottie_speed="1.5"/>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipe_refresh_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:id="@+id/swipe_refresh_layout">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
@ -43,31 +43,29 @@
android:id="@+id/fab_layout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:clipToPadding="false"
android:gravity="center_vertical"
android:padding="4dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent">
app:layout_constraintEnd_toEndOf="parent"
android:padding="4dp"
android:clipToPadding="false"
android:layout_marginEnd="16dp"
android:gravity="center_vertical"
android:layout_marginBottom="16dp"
android:layout_gravity="bottom|end"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Neuer Eintrag"
android:textColor="#FFFFFF"
tools:ignore="HardcodedText" />
android:text="Neuer Eintrag" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab1"
style="?attr/floatingActionButtonSmallStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
app:srcCompat="@drawable/_icon_add"
tools:ignore="ContentDescription" />
app:fabSize="mini" />
</LinearLayout>
@ -75,30 +73,30 @@
android:id="@+id/fab_layout2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:clipToPadding="false"
android:gravity="center_vertical"
android:padding="4dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent">
app:layout_constraintEnd_toEndOf="parent"
android:padding="4dp"
android:clipToPadding="false"
android:layout_marginEnd="16dp"
android:gravity="center_vertical"
android:layout_marginBottom="16dp"
android:layout_gravity="bottom|end"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Liste exportieren"
android:textColor="#FFFFFF" />
android:textColor="#FFFFFF"
android:text="Liste exportieren" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab2"
style="?attr/floatingActionButtonSmallStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
app:tint="@null"
app:srcCompat="@drawable/_icon_export"
app:tint="@null" />
app:fabSize="mini" />
</LinearLayout>
@ -106,30 +104,30 @@
android:id="@+id/fab_layout3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:clipToPadding="false"
android:gravity="center_vertical"
android:padding="4dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent">
app:layout_constraintEnd_toEndOf="parent"
android:padding="4dp"
android:clipToPadding="false"
android:layout_marginEnd="16dp"
android:gravity="center_vertical"
android:layout_marginBottom="16dp"
android:layout_gravity="bottom|end"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Techniker verwalten"
android:textColor="#FFFFFF" />
android:textColor="#FFFFFF"
android:text="Techniker verwalten" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab3"
style="?attr/floatingActionButtonSmallStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
app:tint="@null"
app:srcCompat="@drawable/_icon_techniker"
app:tint="@null" />
app:fabSize="mini" />
</LinearLayout>
@ -137,13 +135,13 @@
android:id="@+id/fab_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:clipToPadding="false"
android:gravity="center_vertical"
android:padding="16dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:clipToPadding="false"
android:padding="16dp"
android:layout_gravity="bottom|end"
tools:visibility="visible">
<com.google.android.material.floatingactionbutton.FloatingActionButton
@ -151,9 +149,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
app:fabSize="normal"
app:srcCompat="@drawable/_icon_dot_menu"
tools:ignore="ContentDescription" />
app:fabSize="normal" />
</LinearLayout>
@ -161,11 +158,11 @@
android:id="@+id/progress_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:indeterminate="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

@ -1,19 +1,15 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
kotlin_version = '1.7.21'
navigation_version = '2.5.3'
}
dependencies {
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.4'
classpath 'com.google.gms:google-services:4.3.15'
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$navigation_version"
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'
classpath 'com.google.gms:google-services:4.3.14'
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.5.2"
}
}
plugins {
id 'com.android.application' version '7.4.2' apply false
id 'org.jetbrains.kotlin.android' version "$kotlin_version" apply false
id 'com.android.application' version '7.2.2' apply false
id 'org.jetbrains.kotlin.android' version '1.7.10' apply false
}
task clean(type: Delete) {

@ -12,7 +12,7 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Kotlin code style for this project: "official" or "obsolete":

Binary file not shown.

@ -1,7 +1,6 @@
#Fri Nov 06 23:24:33 CET 2020
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionPath=wrapper/dists
distrubutionSha256Sum=6147605a23b4eff6c334927a86ff3508cb5d6722cd624c97ded4c2e8640f1f87
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
networkTimeout=10000
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

296
gradlew vendored

@ -1,129 +1,78 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#!/usr/bin/env sh
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
MAX_FD="maximum"
warn () {
echo "$*"
} >&2
}
die () {
echo
echo "$*"
echo
exit 1
} >&2
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD=$JAVA_HOME/bin/java
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@ -132,7 +81,7 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
@ -140,105 +89,84 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

56
gradlew.bat vendored

@ -1,20 +1,4 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%"=="" @echo off
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@ -25,23 +9,19 @@
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@ -55,7 +35,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@ -65,26 +45,38 @@ echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal

Loading…
Cancel
Save