-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dependency and module data (#142)
* Add dependency and module data * Updates * Add comment * Add includeDependencyInformation to turn off deps, make config cache compliant * Updates and json changes * Fix * Working but not polymormphic * Working but not polymormphic * Switch back to polymorphism * Working * Fixes * Remove leading /
- Loading branch information
Showing
8 changed files
with
272 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
gradle-plugin/plugin/src/main/kotlin/com/emergetools/android/gradle/util/MapUtils.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.emergetools.android.gradle.util | ||
|
||
fun <K, V> MutableMap<K, List<V>>.putOrAppend( | ||
key: K, | ||
values: List<V>, | ||
appendOnlyDistinct: Boolean = true, | ||
) = get(key)?.let { value -> | ||
val newList = value + values | ||
put(key, if (appendOnlyDistinct) newList.distinct() else newList) | ||
} ?: put(key, values) |
30 changes: 30 additions & 0 deletions
30
...n/plugin/src/main/kotlin/com/emergetools/android/gradle/util/dependencies/Dependencies.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.emergetools.android.gradle.util.dependencies | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class Dependencies( | ||
val modules: List<Module>, | ||
val libraries: List<Library>, | ||
) { | ||
|
||
companion object { | ||
const val JSON_FILE_NAME = "dependencies.json" | ||
} | ||
} | ||
|
||
@Serializable | ||
data class Module( | ||
val name: String, | ||
val path: String, | ||
val isRoot: Boolean = false, | ||
val entries: List<String>, | ||
) | ||
|
||
@Serializable | ||
data class Library( | ||
val groupId: String, | ||
val artifactId: String, | ||
val version: String, | ||
val entries: List<String>, | ||
) |
Oops, something went wrong.