Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions third_party/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,14 @@ intellijPlatform {
val datestamp = DateTimeFormatter.ofPattern("yyyyMMdd").format(LocalDate.now())
val baseVersion = "$nextMajorVersion.0.0-dev.$datestamp"

val commitHash = System.getenv("KOKORO_GIT_COMMIT")
version = if (commitHash != null) "$baseVersion-${commitHash.take(7)}" else baseVersion
val commitHash = System.getenv("KOKORO_GIT_COMMIT") ?: try {
Comment thread
pq marked this conversation as resolved.
providers.exec {
commandLine("git", "rev-parse", "--short", "HEAD")
}.standardOutput.asText.get().trim()
} catch (e: Exception) {
""
}
version = if (commitHash.isNotEmpty()) "$baseVersion-${commitHash.take(7)}" else baseVersion
} else {
version = providers.gradleProperty("pluginVersion")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be for a follow up, but it's confusing that there's a pluginVersion in gradle.properties too (and there's a TODO there to get it from changelog similar to for the dev version. Maybe change that soon since you're working on versioning already..

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's discuss. I'm happy to make any changes to get this more clear. Thanks!

}
Expand Down Expand Up @@ -255,8 +261,16 @@ tasks.register("printCompileClasspath") {
}
}

tasks.register("printVersion") {
doLast {
println(intellijPlatform.pluginConfiguration.version.get())
abstract class PrintVersionTask : org.gradle.api.DefaultTask() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't follow how this task is used - is it only to check the version?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep.

@get:org.gradle.api.tasks.Input
abstract val pluginVersion: org.gradle.api.provider.Property<String>

@org.gradle.api.tasks.TaskAction
fun action() {
println(pluginVersion.get())
}
}

tasks.register<PrintVersionTask>("printVersion") {
pluginVersion.set(intellijPlatform.pluginConfiguration.version)
}
19 changes: 14 additions & 5 deletions third_party/tool/kokoro/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

# To run this script locally from the repository root:
# JB_MARKETPLACE_TOKEN="your_real_token" ./third_party/tool/kokoro/deploy.sh

source ./third_party/tool/kokoro/setup.sh
setup

Expand All @@ -18,12 +21,18 @@ echo "kokoro deploy start"
DART_KEYSTORE_ID=74840
DART_KEYSTORE_NAME=jetbrains-plugin-upload-auth-token

KOKORO_TOKEN_FILE="${KOKORO_KEYSTORE_DIR}/${DART_KEYSTORE_ID}_${DART_KEYSTORE_NAME}"
if [ ! -f "$KOKORO_TOKEN_FILE" ]; then
echo "Error: Keystore token file not found at $KOKORO_TOKEN_FILE"
exit 1
if [ -n "$JB_MARKETPLACE_TOKEN" ]; then
TOKEN="$JB_MARKETPLACE_TOKEN"
echo "Using token from JB_MARKETPLACE_TOKEN environment variable."
else
KOKORO_TOKEN_FILE="${KOKORO_KEYSTORE_DIR}/${DART_KEYSTORE_ID}_${DART_KEYSTORE_NAME}"
if [ ! -f "$KOKORO_TOKEN_FILE" ]; then
echo "Error: Keystore token file not found at $KOKORO_TOKEN_FILE"
echo "Please set JB_MARKETPLACE_TOKEN or ensure KOKORO_KEYSTORE_DIR is set correctly."
exit 1
fi
TOKEN=$(cat "$KOKORO_TOKEN_FILE")
fi
TOKEN=$(cat "$KOKORO_TOKEN_FILE")

ZIP_FILE="build/distributions/Dart.zip"
if [ ! -f "$ZIP_FILE" ]; then
Expand Down
Loading