Skip to content

Commit

Permalink
Upgrade to Intellij Gradle Plugin 2.0.0-RC1
Browse files Browse the repository at this point in the history
  • Loading branch information
pbreault committed Jul 21, 2024
1 parent 9aa7621 commit 240736d
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 60 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ build/
.idea/
*.iml
*.iws

.intellijPlatform/
106 changes: 47 additions & 59 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ plugins {
// https://plugins.jetbrains.com/docs/intellij/android-studio-releases-list.html
id("org.jetbrains.kotlin.jvm") version "1.8.0"

// https://github.com/JetBrains/gradle-intellij-plugin
id("org.jetbrains.intellij") version "1.17.4"
// https://github.com/JetBrains/intellij-platform-gradle-plugin
id("org.jetbrains.intellij.platform") version "2.0.0-rc1"

// https://github.com/ajoberstar/reckon
id("org.ajoberstar.reckon") version "0.14.0"
Expand All @@ -24,44 +24,21 @@ plugins {

repositories {
mavenCentral()
}

group = "com.developerphil.intellij.plugin.adbidea"

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

intellij {
pluginName.set("adb_idea")
updateSinceUntilBuild.set(false)
type.set("AI")
plugins.set(listOf("android"))

// Set this path to point to a locally installed version of android studio.
// see gradle.properties for more info
if (project.hasProperty("localIdeOverride")) {
localPath.set(property("localIdeOverride").toString())
} else {
version.set(property("ideVersion").toString())
}

tasks.instrumentCode {
compilerVersion.set("231.9225.16")
intellijPlatform {
defaultRepositories()
}
}


tasks.patchPluginXml {
sinceBuild.set(project.property("sinceBuild").toString())

// Extract the most recent entries in CHANGELOG.md and add them to the change notes.
intellijPlatform {
pluginConfiguration {
name = "adb_idea"
group = "com.developerphil.intellij.plugin.adbidea"
changeNotes.set(provider { recentChanges(HTML) })
}
ideaVersion.sinceBuild.set(project.property("sinceBuild").toString())

tasks.runIde {
jvmArgs = listOf("-Xmx4096m", "-XX:+UnlockDiagnosticVMOptions")
}
buildSearchableOptions.set(false)
instrumentCode = true
}

changelog {
Expand All @@ -73,44 +50,55 @@ changelog {
combinePreReleases.set(true)
}

reckon {
scopeFromProp()
snapshotFromProp()
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

tasks.runIde {
jvmArgs = listOf("-Xmx4096m", "-XX:+UnlockDiagnosticVMOptions")
}

tasks.register("printLastChanges") {
doLast {
println(recentChanges(outputType = MARKDOWN))
}
}

fun recentChanges(outputType: Changelog.OutputType): String {
var s = ""
changelog.getAll()
.toList()
.drop(1) // drop the [Unreleased] section
.take(5) // last 5 changes
.forEach { (key, _) ->
s += changelog.renderItem(
changelog
.get(key)
.withHeader(false)
.withEmptySections(false),
outputType
)
dependencies {
intellijPlatform {
bundledPlugin("org.jetbrains.android")
instrumentationTools()
if (project.hasProperty("localIdeOverride")) {
local(property("localIdeOverride").toString())
} else {
androidStudio(property("ideVersion").toString())
}

return s
}
}

dependencies {
implementation("org.jooq:joor-java-8:0.9.14")

testImplementation("junit:junit:4.13.2")
testImplementation("org.mockito:mockito-core:4.7.0")
testImplementation("com.google.truth:truth:1.1.3")
testImplementation("com.google.truth:truth:1.4.4")
}

reckon {
scopeFromProp()
snapshotFromProp()
fun recentChanges(outputType: Changelog.OutputType): String {
var s = ""
changelog.getAll().toList().drop(1) // drop the [Unreleased] section
.take(5) // last 5 changes
.forEach { (key, _) ->
s += changelog.renderItem(
changelog.get(key).withHeader(false).withEmptySections(false), outputType
)
}

return s
}

tasks.buildSearchableOptions {
isEnabled = false
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 240736d

Please sign in to comment.