forked from craigmiller160/kotlin-result-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupload_maven.gradle
26 lines (23 loc) · 1.1 KB
/
upload_maven.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
apply plugin: 'maven-publish'
// Because the components are created only during the afterEvaluate phase, you must
// configure your publications using the afterEvaluate() lifecycle method.
afterEvaluate {
publishing {
publications {
// Creates a Maven publication called "ktxLibrary".
ktxLibrary(MavenPublication) {
// Applies the component for the release build variant.
from components.java
Objects.requireNonNull(mavenGroupId, "Maven base path must not be null")
Objects.requireNonNull(artifactVersion, "Artifact version must not be null")
if (mavenGroupId.isEmpty() || artifactVersion.isEmpty()) {
throw new IllegalStateException("mavenGroupId ($mavenGroupId) and artifactVersion ($artifactVersion) should not be empty")
}
// You can then customize attributes of the publication here.
groupId = mavenGroupId
artifactId = repositoryProjectName
version = artifactVersion
}
}
}
}