forked from LanderlYoung/Jenny
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
100 lines (88 loc) · 3.66 KB
/
build.gradle
File metadata and controls
100 lines (88 loc) · 3.66 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
pub = [
publishVersion: '1.2.0',
user : 'e0177',
user_url : 'https://github.com/e0177',
groupId : 'io.github.e0177',
desc : 'Java/Android JNI glue/proxy code generator',
website : 'https://github.com/e0177/Jenny',
scm_url : 'scm:git:git://github.com/e0177/Jenny.git',
licences : ['Apache-2.0']
]
kotlin_version = '1.4.30'
configRepo = { repo ->
repo.mavenLocal()
repo.jcenter()
repo.google()
}
}
configRepo repositories
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'org.jetbrains.dokka:dokka-gradle-plugin:1.4.30'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.14.2'
classpath 'com.android.tools.build:gradle:4.1.0'
}
}
allprojects {
// basic
configRepo buildscript.repositories
configRepo repositories
// config
group = pub.groupId
version = pub.publishVersion
description = pub.desc
// publish
final def publishProject = [
"annotation", "compiler"
] as Set
if (publishProject.contains(name)) {
// guide doc https://madhead.me/posts/no-bullshit-maven-publish/
// publish plugin repo https://github.com/vanniktech/gradle-maven-publish-plugin
apply plugin: "com.vanniktech.maven.publish"
// gpg sign config
// https://github.com/vanniktech/gradle-maven-publish-plugin/blob/master/.github/workflows/publish-release.yml
signing {
if (project.hasProperty('SIGNING_PRIVATE_KEY') && project.hasProperty('SIGNING_PASSWORD')) {
useInMemoryPgpKeys(project.getProperty('SIGNING_PRIVATE_KEY'), project.getProperty('SIGNING_PASSWORD'))
}
}
// https://github.com/vanniktech/gradle-maven-publish-plugin/issues/206
publishing {
repositories {
withType(MavenArtifactRepository) {
if (name == "local") return
def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
if (version.endsWith("SNAPSHOT")) {
url = uri(snapshotsRepoUrl)
} else {
url = uri(releasesRepoUrl)
}
credentials {
if (hasProperty('mavenCentralRepositoryUsername')
&& hasProperty('mavenCentralRepositoryPassword')) {
username = mavenCentralRepositoryUsername
password = mavenCentralRepositoryPassword
}
}
}
}
}
mavenPublish {
nexus {
baseUrl = "https://s01.oss.sonatype.org/service/local/"
stagingProfile = pub.groupId
if (hasProperty('mavenCentralRepositoryUsername')
&& hasProperty('mavenCentralRepositoryPassword')) {
repositoryUsername = mavenCentralRepositoryUsername
repositoryPassword = mavenCentralRepositoryPassword
}
}
}
// publish to mavenLocal
// ./gradlew -PRELEASE_SIGNING_ENABLED=false publishToMavenLocal
}
}