-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
90 lines (83 loc) · 3.11 KB
/
build.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
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
plugins {
id 'java'
id 'maven-publish'
id 'signing'
}
group 'io.github.knife-fish'
version '2.0.0'
repositories {
mavenCentral()
}
dependencies {
testImplementation 'junit:junit:4.13.1'
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.8.2")
}
test {
useJUnitPlatform()
}
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
gpr(MavenPublication) {
from components.java
pom {
name = 'Generate Fake User Agent String'
description = 'Chrome/Firefox/Safari/Edge/UC/QQ/Baidu/Wechat/App user agent strings generator for Mac/Linux/Windows/Android'
url = 'https://github.com/knife-fish/fake-useragent'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'evil0th'
name = 'Eric'
email = 'cs.liaow@gmail.com'
organization = 'Knifefish'
organizationUrl = 'https://github.com/knife-fish'
}
}
issueManagement {
system = 'GitHub'
url = 'https://github.com/knife-fish/fake-useragent/issues'
}
scm {
connection = 'scm:git:git://github.com/knife-fish/fake-useragent.git'
developerConnection = 'scm:git:ssh://github.com:knife-fish/fake-useragent.git'
url = 'https://github.com/knife-fish/fake-useragent.git'
}
}
}
}
repositories {
maven {
name = "OSSRH"
url = version.endsWith("SNAPSHOT") ? "https://s01.oss.sonatype.org/content/repositories/snapshots/" : "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username = project.findProperty("ossrh.username") ?: System.getenv("OSSRH_USERNAME")
password = project.findProperty("ossrh.password") ?: System.getenv("OSSRH_TOKEN")
}
// then login to https://s01.oss.sonatype.org/ and release, `Staging Repositories`, Close->Confirm, Release->Confirm
// https://central.sonatype.org/publish/release/#locate-and-examine-your-staging-repository
}
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/knife-fish/fake-useragent"
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}
}
}
signing {
def signingKey = findProperty("signingKey") ?: System.getenv("GPG_PRIVATE_KEY")
def signingPassphrase = findProperty("signingPassphrase") ?: System.getenv("GPG_PASSPHRASE")
useInMemoryPgpKeys(signingKey, signingPassphrase)
sign(publishing.publications)
}