- Add the
build_pull_request.shto the root of your git repository; - Add the
android.ymlfile to.github/workflows/; - Make
build_pull_request.shexecutable using:chmod +x build_pull_request.sh; - Commit your code and push the changes
# MIT License
| import android.text.TextUtils; | |
| import android.util.Log; | |
| import com.google.gson.Gson; | |
| import com.google.gson.GsonBuilder; | |
| import com.google.gson.JsonParser; | |
| import java.io.File; | |
| import java.io.FileOutputStream; | |
| import java.io.IOException; |
| name: EZRep Build | |
| on: | |
| push: | |
| tags: releases/[1-9]+.[0-9]+.[0-9]+ | |
| branches: master | |
| jobs: | |
| build: | |
| runs-on: windows-latest |
| package com.nostra13.log | |
| import android.util.Log | |
| import com.google.firebase.crashlytics.FirebaseCrashlytics | |
| class CrashlyticsLogger(private val isDebug: Boolean) : Logger() { | |
| private val priorityStr = mapOf( | |
| Log.VERBOSE to "V", | |
| Log.DEBUG to "D", |
| import org.junit.rules.TestWatcher | |
| import kotlinx.coroutines.Dispatchers | |
| import kotlinx.coroutines.ExperimentalCoroutinesApi | |
| import kotlinx.coroutines.test.* | |
| import org.junit.runner.Description | |
| @ExperimentalCoroutinesApi | |
| class CoroutineTestRule(val dispatcher: TestCoroutineDispatcher = TestCoroutineDispatcher()) : TestWatcher() { | |
| override fun starting(description: Description?) { |
| image: seanghay/android-ci | |
| before_script: | |
| - chmod +x ./gradlew | |
| stages: | |
| - build | |
| cache: | |
| paths: | |
| - .gradle/wrapper | |
| - .gradle/caches | |
| assembleDebug: |
| package manager | |
| import android.content.Context | |
| import android.net.ConnectivityManager | |
| import android.net.Network | |
| import android.net.NetworkCapabilities | |
| import android.net.NetworkRequest | |
| import android.os.Build | |
| import android.util.Log | |
| import com.jakewharton.rxrelay2.BehaviorRelay |
| // https://github.com/Zhuinden/fragmentviewbindingdelegate-kt | |
| import android.view.View | |
| import androidx.fragment.app.Fragment | |
| import androidx.lifecycle.DefaultLifecycleObserver | |
| import androidx.lifecycle.Lifecycle | |
| import androidx.lifecycle.LifecycleOwner | |
| import androidx.lifecycle.Observer | |
| import androidx.viewbinding.ViewBinding | |
| import kotlin.properties.ReadOnlyProperty |
| import android.os.Bundle | |
| import androidx.fragment.app.Fragment | |
| import androidx.fragment.app.activityViewModels | |
| import androidx.fragment.app.viewModels | |
| import androidx.lifecycle.AbstractSavedStateViewModelFactory | |
| import androidx.lifecycle.SavedStateHandle | |
| import androidx.lifecycle.ViewModel | |
| import androidx.lifecycle.ViewModelProvider | |
| import androidx.savedstate.SavedStateRegistryOwner |
| /** | |
| * Holds and manages ViewBinding inside a Fragment. | |
| */ | |
| interface ViewBindingHolder<T : ViewBinding> { | |
| val binding: T? | |
| /** | |
| * Saves the binding for cleanup on onDestroy, calls the specified function [onBound] with `this` value | |
| * as its receiver and returns the bound view root. |