def Group(Closure closure) {
    closure.delegate = dependencies
    return closure
}

ext {

    androidx = Group {
        implementation Dependencies.appCompat
        implementation Dependencies.androidxFragment
        compileOnly Dependencies.androidxAnnotation
        implementation Dependencies.androidxRecyclerView
        implementation Dependencies.androidxCore
        implementation Dependencies.androidxConstraintLayout
        implementation Dependencies.androidxPref
        implementation Dependencies.androidxWork
        implementation Dependencies.swipeRefreshLayout
        implementation Dependencies.biometricLib
        implementation Dependencies.viewPager2Lib
        // Lifecycle
        implementation Dependencies.lifecyclerLiveDataCore
        implementation Dependencies.lifeCycleExtension
        // Room
        implementation Dependencies.roomLibs
        implementation Dependencies.roomExtension
        implementation Dependencies.roomPaging
        kapt Dependencies.roomCompiler
        //Paging
        implementation Dependencies.pagingLib
        // Not really AndroidX
        implementation Dependencies.materialDesign
    }

    network = Group {
        implementation Dependencies.retrofitLibs
        implementation Dependencies.retrofitMoshi
        implementation Dependencies.retrofitScalar
    }

    kotlin = Group {
        implementation Dependencies.kotlinLib
        implementation Dependencies.coroutineCore
    }

    moshi = Group {
        implementation Dependencies.moshiLib
        kapt Dependencies.moshiCodegen
    }

    glide = Group {
        implementation Dependencies.glideLib
        implementation Dependencies.glideOkHttpExtension
        kapt Dependencies.glideCompiler
    }

    markdown = Group {
        implementation Dependencies.markdownLib
        implementation Dependencies.markdownStrikeThroughExtension
        implementation Dependencies.markdownAutoLink
    }

    testing = Group {
        // junit
        testImplementation Dependencies.jUnitApi
        testRuntimeOnly Dependencies.junitEngine
        testImplementation Dependencies.jUnitParameter

        testImplementation Dependencies.mockWebServer
        androidTestImplementation Dependencies.testRunner
        androidTestUtil Dependencies.testOrchestrator
    }
}