Skip to content

foodiestudio/devtools

Repository files navigation

dev tools

Preview

Getting Started

// settings.gradle.kts
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        //...
        maven("https://jitpack.io")
    }
}

// build.gradle.kts
dependencies {
    debugImplementation("com.github.foodiestudio:devtools:$version")
}

Initialization Instructions

The initialization component is registered through App Startup and is implicitly initialized, making it a plug-and-play tool.

However, you can also disable it using the tools:node="remove" method.

<provider
    android:name="androidx.startup.InitializationProvider"
    android:authorities="${applicationId}.androidx-startup"
    android:exported="false"
    tools:node="merge">
    <meta-data
        android:name="com.github.foodiestudio.devtools.DevToolsInitializer"
        tools:node="remove" />
</provider>

Then manually call the initialization method.

DevToolsManager.init(applicationContext)

Integrated Debugging

Please refer to the Gradle documentation for more information.

Temporarily integrate into the main project's setting.gradle.kts, and replace the specific version.

// e.g. ~/open-source/foodiestudio/devtools
includeBuild("/your_path_contain_this_project") {
    dependencySubstitution {
        substitute(module("com.github.foodiestudio:devtools"))
    }
}

For unpublished versions, you can use the source dependencies method to replace the includeBuild, which produces the same result.

// settings.gradle.kts
sourceControl {
    gitRepository(uri("https://github.com/foodiestudio/devtools.git")) {
        producesModule("com.github.foodiestudio:devtools")
    }
}

// build.gradle.kts
debugImplementation("com.github.foodiestudio:devtools") {
    version {
        // branch
        branch = "pre-release/0.1.0" 
    }
}