Skip to content

Commit

Permalink
Merge branch 'DatL4g-develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
mikepenz committed Mar 22, 2024
2 parents 78ecebf + 193f0fa commit ee138c7
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 28 deletions.
1 change: 1 addition & 0 deletions aboutlibraries-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ plugins {
id("com.android.library")
id("org.jetbrains.dokka")
id("com.vanniktech.maven.publish")
kotlin("plugin.serialization") version libs.versions.kotlinCore.get()
}

android {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.ImmutableSet
import kotlinx.collections.immutable.toImmutableList
import kotlinx.collections.immutable.toImmutableSet
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

/**
* The [Libs] class is the main access point to the generated data of the plugin.
* Provides accessors for the [Library] and [License] lists, containing all the dependency information for the module.
*/
@Serializable
data class Libs constructor(
val libraries: ImmutableList<Library>,
val licenses: ImmutableSet<License>,
@SerialName("libraries") val libraries: ImmutableList<Library>,
@SerialName("licenses") val licenses: ImmutableSet<License>,
) {
/**
* Builder used to automatically parse and interpret the generated library data from the plugin.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.mikepenz.aboutlibraries.entity

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

/**
* Describes the [Developer] defined in the `pom.xml` file.
*
Expand All @@ -8,7 +11,8 @@ package com.mikepenz.aboutlibraries.entity
* @param name of the developer
* @param organisationUrl optional organisation url for the developer
*/
@Serializable
data class Developer(
val name: String?,
val organisationUrl: String?
@SerialName("name") val name: String?,
@SerialName("organisationUrl") val organisationUrl: String?
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.mikepenz.aboutlibraries.entity

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

/**
* Describes the [Funding] as defined by the dependency.
* This is only supported for projects hosted for dependencies hosted on: https://github.com/mikepenz/AboutLibraries#special-repository-support
Expand All @@ -8,7 +11,8 @@ package com.mikepenz.aboutlibraries.entity
* @param platform name of the platform allowing to fund the project
* @param url url pointing towards the location to fund the project
*/
@Serializable
data class Funding(
val platform: String,
val url: String
@SerialName("platform") val platform: String,
@SerialName("url") val url: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package com.mikepenz.aboutlibraries.entity
import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.ImmutableSet
import kotlinx.collections.immutable.persistentSetOf
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

/**
* Describes a complete [Library] element, specifying important information about a used dependency.
Expand All @@ -18,18 +20,19 @@ import kotlinx.collections.immutable.persistentSetOf
* @param licenses all identified licenses for this artifact
* @param funding all identified funding opportunities for this artifact
*/
@Serializable
data class Library(
val uniqueId: String,
val artifactVersion: String?,
val name: String,
val description: String?,
val website: String?,
val developers: ImmutableList<Developer>,
val organization: Organization?,
val scm: Scm?,
val licenses: ImmutableSet<License> = persistentSetOf(),
val funding: ImmutableSet<Funding> = persistentSetOf(),
val tag: String? = null,
@SerialName("uniqueId") val uniqueId: String,
@SerialName("artifactVersion") val artifactVersion: String?,
@SerialName("name") val name: String,
@SerialName("description") val description: String?,
@SerialName("website") val website: String?,
@SerialName("developers") val developers: ImmutableList<Developer>,
@SerialName("organization") val organization: Organization?,
@SerialName("scm") val scm: Scm?,
@SerialName("licenses") val licenses: ImmutableSet<License> = persistentSetOf(),
@SerialName("funding") val funding: ImmutableSet<Funding> = persistentSetOf(),
@SerialName("tag") val tag: String? = null,
) {
/**
* defines the [uniqueId]:[artifactVersion] combined
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.mikepenz.aboutlibraries.entity

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

/**
* Describes a complete [License] element.
* Either retrieved from spdx or downloaded from the artifacts repo
Expand All @@ -11,13 +14,14 @@ package com.mikepenz.aboutlibraries.entity
* @param licenseContent contains the whole license content as downloaded from the server
* @param hash usually calculated to identify if a license is re-used and can be used for multiple artifacts
*/
@Serializable
data class License(
val name: String,
val url: String?,
val year: String? = null,
val spdxId: String? = null,
val licenseContent: String? = null,
val hash: String
@SerialName("name") val name: String,
@SerialName("url") val url: String?,
@SerialName("year") val year: String? = null,
@SerialName("spdxId") val spdxId: String? = null,
@SerialName("licenseContent") val licenseContent: String? = null,
@SerialName("hash") val hash: String
) {
override fun equals(other: Any?): Boolean {
if (this === other) return true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.mikepenz.aboutlibraries.entity

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

/**
* Describes the [Organization] defined in the `pom.xml` file.
*
Expand All @@ -8,7 +11,8 @@ package com.mikepenz.aboutlibraries.entity
* @param name of the organisation
* @param url optional url to the website of the defined organisation
*/
@Serializable
data class Organization(
val name: String,
val url: String?
@SerialName("name") val name: String,
@SerialName("url") val url: String?
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.mikepenz.aboutlibraries.entity

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

/**
* Describes the [Scm] defined in the `pom.xml` file.
*
Expand All @@ -9,8 +12,9 @@ package com.mikepenz.aboutlibraries.entity
* @param developerConnection optionally describing the developer connection
* @param url optionally linking to the hosted form of this artifact
*/
@Serializable
data class Scm(
val connection: String?,
val developerConnection: String?,
val url: String?
@SerialName("connection") val connection: String?,
@SerialName("developerConnection") val developerConnection: String?,
@SerialName("url") val url: String?
)

0 comments on commit ee138c7

Please sign in to comment.