-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #225 from NordicSemiconductor/version/2
Version 2.0.0
- Loading branch information
Showing
14 changed files
with
238 additions
and
112 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,12 +30,13 @@ | |
*/ | ||
|
||
import com.android.build.gradle.LibraryExtension | ||
import no.nordicsemi.android.NexusRepositoryPluginExt | ||
import no.nordicsemi.android.buildlogic.getVersionNameFromTags | ||
import no.nordicsemi.android.from | ||
import no.nordicsemi.android.tasks.ReleaseStagingRepositoriesTask | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.api.publish.PublishingExtension | ||
import org.gradle.api.publish.maven.MavenPom | ||
import org.gradle.api.publish.maven.MavenPublication | ||
import org.gradle.kotlin.dsl.extra | ||
import org.gradle.kotlin.dsl.get | ||
|
@@ -95,6 +96,7 @@ class AndroidNexusRepositoryPlugin : Plugin<Project> { | |
// Apply POM configuration. | ||
pom { | ||
from(nexusPluginExt) | ||
packaging = "aar" | ||
} | ||
} | ||
// This task will add *.asc files to the publication for all artifacts. | ||
|
@@ -113,73 +115,4 @@ class AndroidNexusRepositoryPlugin : Plugin<Project> { | |
val publishing = extensions.getByType<PublishingExtension>() | ||
configuration(publishing) | ||
} | ||
|
||
private fun MavenPom.from( | ||
nexusPluginExt: NexusRepositoryPluginExt, | ||
) = with (nexusPluginExt) { | ||
name.set(POM_NAME) | ||
description.set(POM_DESCRIPTION) | ||
url.set(POM_URL) | ||
packaging = POM_PACKAGING | ||
|
||
// https://maven.apache.org/pom.html#licenses | ||
licenses { | ||
license { | ||
name.set(POM_LICENCE) | ||
url.set(POM_LICENCE_URL) | ||
// The two stated methods are repo (they may be downloaded from a Maven repository) or manual (they must be manually installed). | ||
distribution.set("repo") | ||
} | ||
} | ||
|
||
// https://maven.apache.org/pom.html#scm | ||
scm { | ||
url.set(POM_SCM_URL) | ||
connection.set(POM_SCM_CONNECTION) | ||
developerConnection.set(POM_SCM_DEV_CONNECTION) | ||
} | ||
|
||
// https://maven.apache.org/pom.html#organization | ||
organization { | ||
name.set(POM_ORG) | ||
url.set(POM_ORG_URL) | ||
} | ||
|
||
// https://maven.apache.org/pom.html#developers | ||
developers { | ||
developer { | ||
id.set(POM_DEVELOPER_ID) | ||
name.set(POM_DEVELOPER_NAME) | ||
email.set(POM_DEVELOPER_EMAIL) | ||
organization.set(POM_ORG) | ||
organizationUrl.set(POM_ORG_URL) | ||
} | ||
} | ||
} | ||
} | ||
|
||
abstract class NexusRepositoryPluginExt { | ||
// Required parameters: | ||
lateinit var POM_ARTIFACT_ID: String | ||
lateinit var POM_NAME: String | ||
lateinit var POM_DESCRIPTION: String | ||
lateinit var POM_URL: String | ||
lateinit var POM_SCM_URL: String | ||
lateinit var POM_SCM_CONNECTION: String | ||
lateinit var POM_SCM_DEV_CONNECTION: String | ||
|
||
// Default values: | ||
var POM_PACKAGING: String = "aar" | ||
var POM_GROUP: String? = null // If not set, the project's "group" will be used. | ||
|
||
// License | ||
var POM_LICENCE: String = "BSD-3-Clause" | ||
var POM_LICENCE_URL: String = "http://opensource.org/licenses/BSD-3-Clause" | ||
|
||
// Developer | ||
var POM_DEVELOPER_ID: String = "mag" | ||
var POM_DEVELOPER_NAME: String = "Mobile Applications Group" | ||
var POM_DEVELOPER_EMAIL: String = "[email protected]" | ||
var POM_ORG: String = "Nordic Semiconductor ASA" | ||
var POM_ORG_URL: String = "https://www.nordicsemi.com" | ||
} |
Oops, something went wrong.