-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support different IJ versions (232 and 233) for now
- Loading branch information
Showing
8 changed files
with
109 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import org.gradle.api.Project | ||
|
||
enum class SupportedIJVersion { | ||
IJ_232, | ||
IJ_233 | ||
} | ||
|
||
fun Project.supportedIJVersion(): SupportedIJVersion { | ||
val prop = localProperty("supported.ij.version") | ||
?: error( | ||
"'supported.ij.version' gradle property is missing. " + | ||
"Please, provide it using local.properties file or -Psupported.ij.version argument in CLI" | ||
) | ||
|
||
return when (prop) { | ||
"232" -> SupportedIJVersion.IJ_232 | ||
"233" -> SupportedIJVersion.IJ_233 | ||
else -> { | ||
error( | ||
"Invalid 'supported.ij.version' with value '$prop' is provided. " + | ||
"It should be in set of these values: ('232', '233')" | ||
) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import org.gradle.api.Project | ||
import java.util.Properties | ||
|
||
internal fun Project.localProperty(propertyName: String): String? { | ||
val localPropertiesFile = rootProject.file("local.properties") | ||
if (!localPropertiesFile.exists()) { | ||
return null | ||
} | ||
val properties = Properties() | ||
localPropertiesFile.inputStream().use { properties.load(it) } | ||
return properties.getProperty(propertyName) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
plugins { | ||
jewel | ||
`jewel-publish` | ||
alias(libs.plugins.composeDesktop) | ||
} | ||
|
||
dependencies { | ||
api(projects.intUi.intUiStandalone) | ||
compileOnly(libs.bundles.idea232) | ||
} | ||
|
||
tasks.withType<AbstractPublishToMaven>().configureEach { | ||
enabled = supportedIJVersion() == SupportedIJVersion.IJ_232 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
plugins { | ||
jewel | ||
`jewel-publish` | ||
alias(libs.plugins.composeDesktop) | ||
} | ||
|
||
dependencies { | ||
api(projects.intUi.intUiStandalone) | ||
compileOnly(libs.bundles.idea233) | ||
} | ||
|
||
tasks.withType<AbstractPublishToMaven>().configureEach { | ||
enabled = supportedIJVersion() == SupportedIJVersion.IJ_233 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters