-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
90 lines (81 loc) · 2.96 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
import org.gradle.nativeplatform.platform.internal.Architectures
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
plugins {
id 'java'
id 'maven-publish'
}
group 'ru.redguy'
version '2.0.12'
def brotliVersion = "1.11.0"
def operatingSystem = DefaultNativePlatform.getCurrentOperatingSystem()
repositories {
mavenCentral()
}
java {
registerFeature('brotliSupport') {
usingSourceSet(sourceSets.main)
}
registerFeature('jsonSupport') {
usingSourceSet(sourceSets.main)
}
}
dependencies {
implementation 'org.jetbrains:annotations:20.1.0'
jsonSupportImplementation 'com.google.code.gson:gson:2.11.0'
brotliSupportImplementation "com.aayushatharva.brotli4j:brotli4j:$brotliVersion"
brotliSupportRuntimeOnly("""com.aayushatharva.brotli4j:native-${
if (operatingSystem.isWindows()) "windows-x86_64"
else if (operatingSystem.isMacOsX())
if (DefaultNativePlatform.getCurrentArchitecture().isArm()) "osx-aarch64"
else "osx-x86_64"
else if (operatingSystem.isLinux())
if (Architectures.ARM_V7.isAlias(DefaultNativePlatform.getCurrentArchitecture().getName())) "linux-armv7"
//else if (Architectures.AARCH64.isAlias(DefaultNativePlatform.getCurrentArchitecture().getName())) "linux-aarch64"
else if (Architectures.X86_64.isAlias(DefaultNativePlatform.getCurrentArchitecture().getName())) "linux-x86_64"
else
throw new IllegalStateException("Unsupported architecture: ${DefaultNativePlatform.getCurrentArchitecture().getName()}");
else
throw new IllegalStateException("Unsupported operating system: $operatingSystem");
}:$brotliVersion""")
}
test {
}
publishing {
repositories {
maven {
url = "https://rep.redguy.org/repo/maven/"
credentials {
username = System.getenv("MVN_USER")
password = System.getenv("MVN_PASSWORD")
}
}
}
publications {
maven(MavenPublication) {
from components.java
pom {
name = 'JRWeb'
description = 'Lightweight Java web server'
url = 'https://github.com/RedGuys/jrweb'
licenses {
license {
name = 'MIT License'
url = 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id = 'RedGuy'
name = 'Ilya Petrov'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:https://github.com/RedGuys/jrweb.git'
developerConnection = 'scm:git:https://github.com/RedGuys/jrweb.git'
url = 'https://github.com/RedGuys/jrweb'
}
}
}
}
}