Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): fix packaging of the segment key INTELLIJ-148 #110

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,14 @@ jmhReport {
}

tasks {
register("buildProperties", WriteProperties::class) {
group = "build"
if (pluginBundle.enableBundle.get() == true) {
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this condition checking?

register("buildProperties", WriteProperties::class) {
group = "build"

destinationFile.set(project.layout.projectDirectory.file("src/main/resources/build.properties"))
property("pluginVersion", rootProject.version)
property("segmentApiKey", System.getenv("BUILD_SEGMENT_API_KEY") ?: "<none>")
destinationFile.set(project.layout.projectDirectory.file("src/main/resources/build.properties"))
property("pluginVersion", rootProject.version)
property("segmentApiKey", System.getenv("BUILD_SEGMENT_API_KEY") ?: "<none>")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we fail the build here - otherwise if we misconfigure the build environment, we can end up with a bundle without a segment key.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, that is exactly what happened tbf when we modernised the build configuration with jetbrains best practices.

The thing is that we want to be able to build a version without access to segment. Ideally, we will enable Segment only in "main" and disable segment in the "beta" channel. We need to think more about this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps we fail the build if that environment variable is not present and we set it to "" for beta/local builds?

}
}

named("test", Test::class) {
Expand Down Expand Up @@ -204,8 +206,10 @@ tasks {
version.set(libs.versions.intellij.remoteRobot)
}

withType<ProcessResources> {
dependsOn("buildProperties")
if (pluginBundle.enableBundle.get() == true) {
withType<ProcessResources> {
dependsOn("buildProperties")
}
}

patchPluginXml {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading