File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,8 +45,14 @@ intellijPlatform {
4545 val datestamp = DateTimeFormatter .ofPattern(" yyyyMMdd" ).format(LocalDate .now())
4646 val baseVersion = " $nextMajorVersion .0.0-dev.$datestamp "
4747
48- val commitHash = System .getenv(" KOKORO_GIT_COMMIT" )
49- version = if (commitHash != null ) " $baseVersion -${commitHash.take(7 )} " else baseVersion
48+ val commitHash = System .getenv(" KOKORO_GIT_COMMIT" ) ? : try {
49+ providers.exec {
50+ commandLine(" git" , " rev-parse" , " --short" , " HEAD" )
51+ }.standardOutput.asText.get().trim()
52+ } catch (e: Exception ) {
53+ " "
54+ }
55+ version = if (commitHash.isNotEmpty()) " $baseVersion -${commitHash.take(7 )} " else baseVersion
5056 } else {
5157 version = providers.gradleProperty(" pluginVersion" )
5258 }
@@ -253,8 +259,16 @@ tasks.register("printCompileClasspath") {
253259 }
254260}
255261
256- tasks.register(" printVersion" ) {
257- doLast {
258- println (intellijPlatform.pluginConfiguration.version.get())
262+ abstract class PrintVersionTask : org.gradle.api.DefaultTask () {
263+ @get:org.gradle.api.tasks.Input
264+ abstract val pluginVersion: org.gradle.api.provider.Property <String >
265+
266+ @org.gradle.api.tasks.TaskAction
267+ fun action () {
268+ println (pluginVersion.get())
259269 }
260270}
271+
272+ tasks.register<PrintVersionTask >(" printVersion" ) {
273+ pluginVersion.set(intellijPlatform.pluginConfiguration.version)
274+ }
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3+ # To run this script locally from the repository root:
4+ # JB_MARKETPLACE_TOKEN="your_real_token" ./third_party/tool/kokoro/deploy.sh
5+
36source ./third_party/tool/kokoro/setup.sh
47setup
58
@@ -18,12 +21,18 @@ echo "kokoro deploy start"
1821DART_KEYSTORE_ID=74840
1922DART_KEYSTORE_NAME=jetbrains-plugin-upload-auth-token
2023
21- KOKORO_TOKEN_FILE=" ${KOKORO_KEYSTORE_DIR} /${DART_KEYSTORE_ID} _${DART_KEYSTORE_NAME} "
22- if [ ! -f " $KOKORO_TOKEN_FILE " ]; then
23- echo " Error: Keystore token file not found at $KOKORO_TOKEN_FILE "
24- exit 1
24+ if [ -n " $JB_MARKETPLACE_TOKEN " ]; then
25+ TOKEN=" $JB_MARKETPLACE_TOKEN "
26+ echo " Using token from JB_MARKETPLACE_TOKEN environment variable."
27+ else
28+ KOKORO_TOKEN_FILE=" ${KOKORO_KEYSTORE_DIR} /${DART_KEYSTORE_ID} _${DART_KEYSTORE_NAME} "
29+ if [ ! -f " $KOKORO_TOKEN_FILE " ]; then
30+ echo " Error: Keystore token file not found at $KOKORO_TOKEN_FILE "
31+ echo " Please set JB_MARKETPLACE_TOKEN or ensure KOKORO_KEYSTORE_DIR is set correctly."
32+ exit 1
33+ fi
34+ TOKEN=$( cat " $KOKORO_TOKEN_FILE " )
2535fi
26- TOKEN=$( cat " $KOKORO_TOKEN_FILE " )
2736
2837ZIP_FILE=" build/distributions/Dart.zip"
2938if [ ! -f " $ZIP_FILE " ]; then
You can’t perform that action at this time.
0 commit comments