-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
224 lines (198 loc) · 6.72 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
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
plugins {
id 'org.jetbrains.intellij' version '1.17.4'
id 'java'
id 'antlr'
id 'scala'
id 'net.researchgate.release' version '3.0.2'
id "io.freefair.lombok" version "8.4"
id "maven-publish"
id "signing"
}
sourceCompatibility = '11' // Set Java version here
targetCompatibility = '11' // Set Java version here
group 'io.github.zhangshengshan'
repositories {
mavenLocal()
// add aliyun huawei repo
maven {
url "https://repo.huaweicloud.com/repository/maven/"
}
maven {
url "https://maven.aliyun.com/repository/public"
}
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
maven {
url "https://oss.sonatype.org/content/repositories/releases"
}
maven {
url "https://oss.sonatype.org/service/local/repositories/releases/content"
}
}
sourceSets {
main {
java {
srcDirs = ['src/main/java', 'src/main/gen']
}
scala {
srcDirs = ['src/main/scala']
}
}
}
//compileJava.dependsOn(compileScala)
compileJava.classpath += files(compileScala.destinationDir)
// TODO: 突然发现打出的JAR包不含依赖, 体积骤降,导致相关的类无法加载,调整为打包成fatJar
// FatJar导致包体积过大,需要调整
jar {
archiveClassifier = "all"
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}
task fatJar(type: Jar) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
with jar
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.0'
implementation 'org.antlr:antlr4:4.11.1'
implementation "org.antlr:antlr4-intellij-adaptor:0.1"
implementation 'org.scala-lang:scala-library:2.13.11'
implementation 'com.github.vertical-blank:sql-formatter:2.0.3'
implementation 'io.github.zhangshengshan:mygraphapp_2.13:0.1.8'
// mygraphapp中包含此依赖,此处不再需要,防止冲突
// implementation 'io.github.zhangshengshan:mycommongraph_2.13:0.0.12'
implementation 'com.intellij:forms_rt:7.0.3'
implementation 'com.google.code.gson:gson:2.10'
// for requests ospath and json parsesupport
implementation 'com.lihaoyi:requests_2.13:0.8.0'
implementation 'com.lihaoyi:ujson_2.13:1.4.2'
implementation 'com.lihaoyi:os-lib_2.13:0.7.8'
implementation 'com.lihaoyi:upickle_2.13:1.4.2'
implementation 'mysql:mysql-connector-java:8.0.28'
implementation 'com.typesafe.slick:slick_2.13:3.3.3'
implementation 'com.typesafe.slick:slick-hikaricp_2.13:3.3.3'
// Apache Calcite 核心库
implementation 'org.apache.calcite:calcite-core:1.35.0' // 请根据实际情况替换为最新版本
}
generateGrammarSource {
include("**/ANTLRv4*.g4")
arguments += [
"-package", "org.antlr.intellij.plugin.parser",
"-lib", "src/main/antlr/org/antlr/intellij/plugin/parser",
"-Xexact-output-dir"
]
}
// See https://github.com/JetBrains/gradle-intellij-plugin/
intellij {
version = '2024.3'
}
patchPluginXml {
changeNotes = """ """
}
test {
useJUnitPlatform()
}
release {
ignoredSnapshotDependencies = ["io.github.zhangshengshan:mygraphapp_2.13"]
}
task sourceJar(type: Jar) {
from sourceSets.main.allJava
archiveClassifier = "sources"
}
publishing {
publications {
Sonatype(MavenPublication) {
from components.java
artifact sourceJar
pom {
name = "Demo"
description = "A demonstration of Maven POM customization"
url = "https://www.example.com/project"
licenses {
license {
name = "The Apache License, Version 2.0"
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
id = "zhangshengshan"
name = "alphabetago"
email = "[email protected]"
}
}
scm {
connection = "scm:svn:https://subversion.example.com/svn/project/trunk/"
developerConnection = "scm:git:ssh:githubcom:zhangshengshan/MyOpenHivePlugin.git"
url = "https://github.com/zhangshengshan/MyOpenHivePlugin/tree/main"
}
}
}
}
repositories {
// The repository to publish to, Sonatype/MavenCentral
maven {
// This is an arbitrary name, you may also use "mavencentral" or
// any other name that's descriptive for you
name = "datastudio"
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
// You only need this if you want to publish snapshots, otherwise just set the URL
// to the release repo directly
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
// The username and password we've fetched earlier
credentials {
username = OSSRHUSERNAME
password = OSSRHPASSWORD
}
}
maven {
name = "aliyunxiao"
def release_url = 'https://packages.aliyun.com/maven/repository/2440159-release-ZPowfH/'
def snapshot_url = 'https://packages.aliyun.com/maven/repository/2440159-snapshot-iMOtTE/'
url = version.endsWith('SNAPSHOT') ? snapshot_url : release_url
credentials {
username = ALIYUNUSERNAME
password = ALIYUNPASSWORD
}
}
maven {
name = "MyOpenHivePlugin"
url = uri("https://maven.pkg.github.com/zhangshengshan/MyOpenHivePlugin")
credentials {
username = GITHUBUSERNAME
password = GITHUBPASSWORD
}
}
}
}
//signing.keyId =
//signing.password =
//signing.secretKeyRingFile =
//OSSRHUSERNAME =
//OSSRHPASSWORD =
//ALIYUNUSERNAME =
//ALIYUNPASSWORD =
//systemProp.org.gradle.internal.publish.checksums.insecure = true
//afterEvaluate {
// publishing {
// publications {
// Aliyun(MavenPublication) {
// from components.java
// }
// }
// repositories {
// }
// }
//}
signing {
sign publishing.publications.Sonatype
}