File tree 8 files changed +15
-18
lines changed
androidMain/kotlin/com/mikepenz/aboutlibraries/util
commonMain/kotlin/com/mikepenz/aboutlibraries/entity
multiplatformMain/kotlin/com/mikepenz/aboutlibraries/util
plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin
8 files changed +15
-18
lines changed Original file line number Diff line number Diff line change @@ -43,12 +43,13 @@ actual fun parseData(json: String): Result {
43
43
organization,
44
44
scm,
45
45
libLicenses,
46
- funding
46
+ funding,
47
+ optString(" tag" )
47
48
)
48
49
}
49
50
return Result (libraries, licenses)
50
51
} catch (t: Throwable ) {
51
- Log .e(" aboutlibraries " , " Failed to parse aboutlibraries .json: $t " )
52
+ Log .e(" AboutLibraries " , " Failed to parse the meta data * .json file : $t " )
52
53
}
53
54
return Result (emptyList(), emptyList())
54
55
}
Original file line number Diff line number Diff line change @@ -24,7 +24,8 @@ data class Library(
24
24
val organization : Organization ? ,
25
25
val scm : Scm ? ,
26
26
val licenses : Set <License > = emptySet(),
27
- val funding : Set <Funding > = emptySet()
27
+ val funding : Set <Funding > = emptySet(),
28
+ val tag : String? = null ,
28
29
) {
29
30
/* *
30
31
* defines the [uniqueId]:[artifactVersion] combined
Original file line number Diff line number Diff line change @@ -44,12 +44,13 @@ actual fun parseData(json: String): Result {
44
44
organization,
45
45
scm,
46
46
libLicenses,
47
- funding
47
+ funding,
48
+ optString(" tag" )
48
49
)
49
50
}
50
51
return Result (libraries, licenses)
51
52
} catch (t: Throwable ) {
52
- println (" Failed to parse aboutlibraries .json: $t " )
53
+ println (" Failed to parse the meta data * .json file : $t " )
53
54
}
54
55
return Result (emptyList(), emptyList())
55
56
}
Original file line number Diff line number Diff line change 4
4
"artifactVersion" : " 42.0" ,
5
5
"description" : " " ,
6
6
"name" : " ABC Custom Jetpack library" ,
7
+ "tag" : " custom" ,
7
8
"licenses" : [
8
9
" asdkl"
9
10
]
Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ data class Library(
16
16
var scm : Scm ? ,
17
17
var licenses : Set <String > = emptySet(),
18
18
var funding : Set <Funding > = emptySet(),
19
- var artifactFolder : File ? = null
19
+ var tag : String? = null ,
20
+ var artifactFolder : File ? = null ,
20
21
) {
21
22
val artifactId: String
22
23
get() = " ${uniqueId} :${artifactVersion ? : " " } "
Original file line number Diff line number Diff line change @@ -240,6 +240,7 @@ class LibrariesProcessor(
240
240
scm,
241
241
licenses.map { it.hash }.toSet(),
242
242
funding,
243
+ null ,
243
244
artifactFile.parentFile?.parentFile // artifactFile references the pom directly
244
245
)
245
246
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ fun Library.merge(with: Library) {
58
58
with.name?.takeIf { it.isNotBlank() }?.also { orgLib.name = it }
59
59
with.description?.takeIf { it.isNotBlank() }?.also { orgLib.description = it }
60
60
with.website?.takeIf { it.isNotBlank() }?.also { orgLib.website = it }
61
+ with.tag?.takeIf { it.isNotBlank() }?.also { orgLib.tag = it }
61
62
62
63
// merge custom data with original data
63
64
val origOrganization = orgLib.organization
Original file line number Diff line number Diff line change @@ -55,25 +55,15 @@ object LibraryReader {
55
55
organization,
56
56
scm,
57
57
licenses,
58
- funding
58
+ funding,
59
+ c[" tag" ] as ? String
59
60
)
60
61
} catch (t: Throwable ) {
61
62
LOGGER .error(" Could not read the license ($name )" , t)
62
63
null
63
64
}
64
65
}
65
66
66
- /* *
67
- "uniqueId": "androidx.jetpack.library:custom",
68
- "developers": [],
69
- "artifactVersion": "42.0",
70
- "description": "",
71
- "name": "ABC Custom Jetpack library",
72
- "licenses": [
73
- "asdkl"
74
- ]
75
- */
76
-
77
67
private val LOGGER = LoggerFactory .getLogger(LibraryReader ::class .java)!!
78
68
private const val LIBRARIES_DIR = " libraries"
79
69
}
You can’t perform that action at this time.
0 commit comments