-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
120 lines (95 loc) · 3.71 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
import groovy.json.JsonSlurper
import org.jetbrains.intellij.tasks.RunPluginVerifierTask
plugins {
id 'idea'
id 'jacoco'
id 'java'
id 'org.jetbrains.intellij' version '1.17.3'
}
group 'io.github.thepieterdc.dodona'
version '2.2.1-SNAPSHOT'
java {
sourceCompatibility = JavaVersion.VERSION_17
}
repositories {
mavenCentral()
maven {
url = "https://maven.pkg.github.com/thepieterdc/dodona-api-java"
credentials {
username = "PublicToken"
password = "\u0064\u0064\u0066\u0039\u0036\u0065\u0030\u0063\u0061\u0032\u0066\u0065\u0032\u0039\u0033\u0033\u0036\u0030\u0035\u0062\u0031\u0033\u0031\u0035\u0038\u0063\u0061\u0064\u0061\u0033\u0030\u0031\u0030\u0035\u0062\u0037\u0035\u0032\u0066\u0061"
}
}
}
dependencies {
implementation group: 'io.github.thepieterdc.dodona', name: 'api', version: '2.0.3'
implementation group: 'io.github.thepieterdc.dodona', name: 'impl', version: '2.0.3'
implementation group: 'com.github.marlonlom', name: 'timeago', version: '4.0.3'
testImplementation platform("org.junit:junit-bom:5.10.2")
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: '5.10.2'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.11.0'
testImplementation group: 'io.github.thepieterdc.random', name: 'random', version: '1.0.2'
}
tasks.register('calculateNextVersion') {
doLast {
def version = (project.version as String).split('\\.').collect { Integer.parseInt(it) }
println(String.format("%s.%s.%s", version[0], version[1], version[2] + 1))
}
}
tasks.register('generateBuildConfig') {
var outputDir = file("$projectDir/src/main/java/")
doFirst {
def srcFile = new File(outputDir, "io/github/thepieterdc/dodona/plugin/BuildConfig.java")
srcFile.parentFile.mkdirs()
srcFile.write("""
package io.github.thepieterdc.dodona.plugin;
public class BuildConfig {
public static final String VERSION = "$project.version";
}
""")
}
group = "build"
outputs.upToDateWhen { false }
}
compileJava.dependsOn generateBuildConfig
prepareKotlinBuildScriptModel.dependsOn generateBuildConfig
static def getVerifiableVersions() {
def versions = ["IC-241.14494.240"]
// Get the list of all versions.
def versionUrl = new URL("https://data.services.jetbrains.com/products?code=IIC%2CPCC&fields=code%2Creleases.build%2Creleases.type")
def parsedJson = new JsonSlurper().parse(versionUrl)
// Find the latest release IntelliJ version.
versions.add(String.format("IC-%s", parsedJson.find { it -> it.code == "IIC" }.releases.find { it -> it.type == "release" }.build))
return versions
}
intellij {
downloadSources.set(false)
pluginName.set('dodona')
plugins.set(['java', 'PythonCore:241.14494.17'])
updateSinceUntilBuild.set(false)
version.set('241.14494.240')
}
jacocoTestReport {
dependsOn test
reports {
html.required = true
xml.required = true
}
}
patchPluginXml {
changeNotes = """
"""
pluginDescription = 'Companion plugin for the Ghent University Dodona platform, which allows you to submit exercises right from your favourite JetBrains IDE. More information can be found at <a href="https://docs.dodona.be/en/guides/pycharm-plugin/">https://docs.dodona.be/en/guides/pycharm-plugin/</a>'
sinceBuild = '241.14494.240'
}
publishPlugin {
channels = [(project.version as String).contains("SNAPSHOT") ? "nightly" : "stable"]
token = System.getenv("JETBRAINS_MARKETPLACE_TOKEN")
}
runPluginVerifier {
failureLevel = [RunPluginVerifierTask.FailureLevel.COMPATIBILITY_PROBLEMS]
ideVersions = getVerifiableVersions()
}
wrapper {
gradleVersion = '8.5.0'
}