-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
122 lines (112 loc) · 4.13 KB
/
build.gradle.kts
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
plugins {
id("io.cloudflight.autoconfigure-gradle") version "0.4.0"
`maven-publish`
signing
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
}
description = "Collection of icons for use in architecture diagrams, documentation and training"
group = "io.cloudflight.architectureicons"
version = "0.4.0"
repositories {
mavenCentral()
}
dependencies {
implementation("com.google.code.findbugs:jsr305:3.0.2")
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.8.2")
}
java {
withJavadocJar()
}
autoConfigure {
java {
languageVersion.set(JavaLanguageVersion.of(8))
vendorName.set("Cloudflight")
}
}
/**
* This task needs to be called manually in order to recreate all icons and base64 versions.
* We keep those files in VCS on purpose, as this operation takes quite long (we download all files)
* and we also want to keep track of any changes from the corresponding sources.
*/
tasks.create("generateIcons", io.cloudflight.architectureicons.gradle.IconGeneratorTask::class.java)
/**
* add the content of the Asset-ZIP from https://aws.amazon.com/de/architecture/icons/ to
* the folder awsassets and run this task manually in order to have icons in the given
* resolution being copied to the aws-icons path
*/
tasks.create("copyAwsIcons", org.gradle.api.tasks.Copy::class.java) {
val resolution = "48"
val version = "01312022" // the suffix of the folder in the first level (i.e. Category-Icons_01312022)
from("awsassets") {
include("**/*$resolution.png", "**/*${resolution}_Dark.png")
}
into("aws-icons")
includeEmptyDirs = false
filesMatching("**") {
path = path
.replace("_$version", "")
.replace("/Arch_${resolution}", "")
.replace("/Res_${resolution}_Dark", "")
.replace("/Arch-Category_${resolution}", "")
.replace("/Arch-Category_", "/")
.replace("/Arch_", "/")
.replace("/Res_", "/")
.replace("/${resolution}/", "/")
.replace("_${resolution}_Dark.png", ".png")
.replace("_${resolution}.png", ".png")
.replace("-Icons/", "/")
.replace("/ ", "/")
}
}
publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
pom {
name.set(project.name)
description.set(project.description)
url.set("https://github.com/cloudflightio/architecture-icons")
licenses {
license {
name.set("MIT")
url.set("https://github.com/cloudflightio/architecture-icons/blob/master/LICENSE")
}
}
inceptionYear.set("2022")
organization {
name.set("Cloudflight")
url.set("https://cloudflight.io")
}
developers {
developer {
id.set("klu2")
name.set("Klaus Lehner")
email.set("[email protected]")
}
}
scm {
connection.set("scm:[email protected]:cloudflightio/architecture-icons.git")
developerConnection.set("scm:[email protected]:cloudflightio/architecture-icons.git")
url.set("https://github.com/cloudflightio/architecture-icons")
}
}
}
}
}
nexusPublishing {
repositories {
sonatype { //only for users registered in Sonatype after 24 Feb 2021
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
username.set(System.getenv("MAVEN_USERNAME"))
password.set(System.getenv("MAVEN_PASSWORD"))
}
}
}
signing {
setRequired {
System.getenv("PGP_SECRET") != null
}
useInMemoryPgpKeys(System.getenv("PGP_SECRET"), System.getenv("PGP_PASSPHRASE"))
sign(publishing.publications.getByName("maven"))
}