-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathbuild.gradle
191 lines (163 loc) · 5.82 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
// https://plugins.jetbrains.com/plugin/21229-jini/
// via [email protected] name "pannous" but not login pannous on https://plugins.jetbrains.com/
plugins {
id("java")
// id("com.intellij.java") // version "0.8.0"
// id("com.intellij.modules.java") // for psi
// id("com.intellij.modules.python") // for psi
// id("org.jetbrains.intellij") // version "1.17.2"
id("org.jetbrains.intellij") version "1.17.3"
// id("org.jetbrains.intellij") version intellijPluginVersion
id 'com.github.johnrengelman.shadow' version '8.1.1' // bundle all dependencies into a single jar
// id 'com.github.johnrengelman.shadow' version '7.0.0' // bundle all dependencies into a single jar
// id("dev.bmac.intellij.plugin-uploader") version "1.3.4"
}
group = "com.pannous"
version = "1.2.3.$subversion"
intellij {
version = '2024.1'
// version = '2023.3.6'
// "PsiViewer", ,"python" ???
// setPlugins(["JavaScript","java"]) // for psi
}
task incrementVersion {
Properties ext = new Properties()
File propsFile = new File('gradle.properties')
ext.load(propsFile.newDataInputStream())
// Integer nextbuildnum = ( ((ext.getProperty('subversion')) as BigDecimal) + 1 )
// ext.setProperty('subversion', nextbuildnum.toString())
ext.subversion = (Integer.parseInt(ext.subversion) + 1).toString()
ext.store(propsFile.newWriter(), null)
ext.load(propsFile.newDataInputStream())
}
shadowJar {
archiveClassifier.set("all")
manifest {
attributes(
"Implementation-Title": project.name,
"Implementation-Version": project.version,
)
}
}
// upload to https://plugins.jetbrains.com/plugin/21229-jini
// https://plugins.jetbrains.com/docs/intellij/publishing-plugin.html
// https://plugins.jetbrains.com/docs/intellij/plugin-repository.html
// https://plugins.jetbrains.com/docs/intellij/plugin-portal-api.html
// https://plugins.jetbrains.com/docs/intellij/plugin-portal-api-reference.html
//import org.gradle.plugins.ssh.tasks.Rsync
// upload jar via rsync .ssh/id_rsa to files.pannous.com
// tasks.register('uploadJar', Rsync) {
//task uploadJar(type: Rsync) {
// dependsOn shadowJar
// from shadowJar.archiveFile
// // to server files.pannous.com
// into "[email protected]:/home/me/files/"
// doLast {
// println "uploadJar done"
// }
//}
task uploadMyJar(type: Exec) {
dependsOn shadowJar
// def source = shadowJar.archiveFile
def source = tasks.getByName('shadowJar').outputs.files.singleFile
def target = '[email protected]:/var/www/webpage/files/intelliJini-plugin-latest.jar'
doFirst {
println "uploadMyJar FILES: $source -> $target"
println "http://pannous.com/files/intelliJini-plugin-latest.jar"
}
// Set the command to execute
commandLine 'scp', '-i', '/Users/me/.ssh/id_rsa', source, target
}
shadowJar.finalizedBy uploadMyJar
repositories {
mavenCentral()
}
sourceSets {
main {
java {
exclude("**/**Test.java")
// exclude("**/OpenAI3.java")
exclude("**/OpenAiTheo.java")
exclude("**/theokanning/**")
exclude("**/kousenit/**") //.claudeai
}
}
}
test {
sourceSets {
test {
java.srcDir 'src/main/test/'
}
}
classpath = sourceSets.test.runtimeClasspath
useJUnitPlatform()
}
dependencies {
// https://mvnrepository.com/artifact/com.cjcrafter/openai
// implementation 'io.github.cdimascio:dotenv-java:3.0.0'
// implementation 'com.cjcrafter:openai:2.1.0'
implementation('com.cjcrafter:openai:2.1.0') {
exclude group: 'org.jetbrains', module: 'annotations'
}
// https://mvnrepository.com/artifact/com.theokanning.openai-gpt3-java/service
// implementation 'com.theokanning.openai-gpt3-java:service:0.18.2'
// implementation('org.junit.jupiter:junit-jupiter-api:5.9.2')
testImplementation('org.junit.jupiter:junit-jupiter-api:5.9.2')
testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine:5.9.2')
}
// Configure Gradle IntelliJ Plugin
// Read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
intellij {
// version.set("2023.3.3")
version.set("2023.3.6")
// version.set("2024.1")
// type.set("RR") // Rust Rover preview
// type.set("CL") // Target IDE Platform
// type.set("IC")
type.set("IU")
// IC - IntelliJ IDEA Community Edition
// IU - IntelliJ IDEA Ultimate Edition
// CL - CLion
// PY - PyCharm Professional Edition
// PC - PyCharm Community Edition
// PS - PhpStorm
// RD - Rider
// GO - GoLand
// AI - Android Studio
// plugins.set(listOf(/* Plugin Dependencies */))
}
tasks {
apply plugin: 'java'
// sourceCompatibility = "17"
// targetCompatibility = "17"
sourceCompatibility = "18"
targetCompatibility = "18"
// sourceCompatibility = "20"
// targetCompatibility = "20"
patchPluginXml {
// sinceBuild.set("223")
// sinceBuild.set("233")
// sinceBuild.set("233.3.6")
sinceBuild.set("241")
untilBuild.set("241.*")
// sinceBuild.set("223")
// untilBuild.set("999.*")
// If you want your plugin to be compatible with all future IDEs, you can leave this field empty.
// However, we highly recommend setting it to the latest available IDE version.
}
signPlugin {
certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
privateKey.set(System.getenv("PRIVATE_KEY"))
password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
}
publishPlugin {
token.set(System.getenv("PUBLISH_TOKEN"))
}
}
//configurations.all {
// resolutionStrategy.eachDependency { DependencyResolveDetails details ->
// if (details.requested.group == 'org.jetbrains' && details.requested.name == 'annotations') {
// details.useVersion '24.0.1'
// }
// }
//}