diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 405cb77..0000000 --- a/build.gradle +++ /dev/null @@ -1,44 +0,0 @@ -buildscript { - ext.kotlin_version = '1.8.0' - - repositories { - mavenCentral() - } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - -plugins { - id 'idea' -} - - -idea.project.jdkName = '17' - -allprojects { - apply plugin: "kotlin" - apply plugin: "idea" - repositories { - google() - mavenCentral() - jcenter() - maven { url 'https://jitpack.io' } - } - - dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - } - - compileKotlin { - kotlinOptions { - jvmTarget = "11" - javaParameters = true - } - } -} - -task printVersionName { - println project.findProperty("yampVersion").toString() -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..697eb10 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,21 @@ +plugins { + id("org.jetbrains.kotlin.jvm") version "2.1.0" apply false + id("idea") +} + +idea.project.jdkName = "17" + +allprojects { + apply(plugin = "idea") + repositories { + google() + mavenCentral() + maven(url = "https://jitpack.io") + } +} + +tasks.register("printVersionName") { + doLast { + println(project.findProperty("yampVersion").toString()) + } +} \ No newline at end of file diff --git a/core/build.gradle b/core/build.gradle deleted file mode 100644 index d9dba86..0000000 --- a/core/build.gradle +++ /dev/null @@ -1,29 +0,0 @@ -plugins { - id 'java' -} - -sourceCompatibility = 11 -targetCompatibility = 11 - -repositories { - google() - mavenCentral() - maven { url 'https://jitpack.io' } -} - -dependencies { - implementation 'com.github.Grishberg:simpleperf-parser:1.0.6' - implementation 'com.github.Grigory-Rylov:adb-facade-core:0.1.8' - implementation 'com.github.Grigory-Rylov:andoid_method_trace_recorder:2.1.0' - implementation 'com.github.Grigory-Rylov:proguard-deobfuscator:0.4.0' - implementation 'com.github.Grishberg:mvtrace-dependencies:1.0.1' - implementation 'com.github.Grishberg:tree-table:0.1.1' - - implementation 'com.google.code.gson:gson:2.8.6' - - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-swing:1.3.2' - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.2' - - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" - testImplementation group: 'junit', name: 'junit', version: '4.12' -} diff --git a/core/build.gradle.kts b/core/build.gradle.kts new file mode 100644 index 0000000..823f967 --- /dev/null +++ b/core/build.gradle.kts @@ -0,0 +1,37 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +plugins { + java + kotlin("jvm") +} + +java { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 +} + +kotlin { + jvmToolchain(11) +} + +repositories { + google() + mavenCentral() + maven(url = "https://jitpack.io") +} + +dependencies { + implementation("com.github.Grishberg:simpleperf-parser:1.0.6") + implementation("com.github.Grigory-Rylov:adb-facade-core:0.1.8") + implementation("com.github.Grigory-Rylov:andoid_method_trace_recorder:2.1.0") + implementation("com.github.Grigory-Rylov:proguard-deobfuscator:0.4.0") + implementation("com.github.Grishberg:mvtrace-dependencies:1.0.1") + implementation("com.github.Grishberg:tree-table:0.1.1") + implementation("com.google.code.gson:gson:2.8.6") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-swing:1.3.2") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.2") + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") + testImplementation("junit:junit:4.12") +} + +// Удалён блок с ручной настройкой dependsOn и classpath для JavaCompile \ No newline at end of file diff --git a/core/src/main/java/com/github/grishberg/profiler/chart/flame/FlameChartController.kt b/core/src/main/java/com/github/grishberg/profiler/chart/flame/FlameChartController.kt index a609ab2..5f85080 100644 --- a/core/src/main/java/com/github/grishberg/profiler/chart/flame/FlameChartController.kt +++ b/core/src/main/java/com/github/grishberg/profiler/chart/flame/FlameChartController.kt @@ -465,12 +465,12 @@ class FlameChartController( text.substring(0, text.length - 2) } else text isSearchingInProgress = true - val targetString = if (ignoreCase) textToFind.toLowerCase() else textToFind + val targetString = if (ignoreCase) textToFind.lowercase() else textToFind foundItems.clear() for (element in rectangles) { - val lowerCasedName = if (ignoreCase) element.name.toLowerCase() else element.name + val lowerCasedName = if (ignoreCase) element.name.lowercase() else element.name val isEquals = if (shouldEndsWithText) lowerCasedName.endsWith(targetString) else diff --git a/core/src/main/java/com/github/grishberg/profiler/common/FileSystem.kt b/core/src/main/java/com/github/grishberg/profiler/common/FileSystem.kt index 0d12c96..9b9f014 100644 --- a/core/src/main/java/com/github/grishberg/profiler/common/FileSystem.kt +++ b/core/src/main/java/com/github/grishberg/profiler/common/FileSystem.kt @@ -90,12 +90,12 @@ class FileSystem( zis.closeEntry() zis.close() - val traceFiles = extractedFiles.filter { it.extension.toLowerCase() == "trace" } + val traceFiles = extractedFiles.filter { it.extension.lowercase() == "trace" } if (traceFiles.isEmpty()) { throw IllegalStateException("There is no any .trace files") } val traceFile = traceFiles.first() - val bookmarksFiles = extractedFiles.filter { it.extension.toLowerCase() == BOOKMARK_EXTENSION } + val bookmarksFiles = extractedFiles.filter { it.extension.lowercase() == BOOKMARK_EXTENSION } val bookmarks = if (bookmarksFiles.isNotEmpty()) { Bookmarks(bookmarksFiles.first(), settings, log) @@ -135,7 +135,7 @@ class FileSystem( if (userSelection == JFileChooser.APPROVE_OPTION) { var fileToSave = fileChooser.selectedFile settings.reportsFileDialogDir = fileToSave.parent - if (fileToSave.extension.toLowerCase() != "twb") { + if (fileToSave.extension.lowercase() != "twb") { fileToSave = File(fileToSave.absolutePath + ".twb") } saveTraceWithBookmarks(fileToSave, container) diff --git a/core/src/main/java/com/github/grishberg/profiler/plugins/stages/MethodsAvailabilityImpl.kt b/core/src/main/java/com/github/grishberg/profiler/plugins/stages/MethodsAvailabilityImpl.kt index c7f5dcc..80f9c1a 100644 --- a/core/src/main/java/com/github/grishberg/profiler/plugins/stages/MethodsAvailabilityImpl.kt +++ b/core/src/main/java/com/github/grishberg/profiler/plugins/stages/MethodsAvailabilityImpl.kt @@ -12,7 +12,7 @@ class MethodsAvailabilityImpl : MethodsAvailability { if (isExcludedPackagePrefix(method)) return false if (method.name.contains("$")) { - if (isMethodWithLambdaInName(method.name.toLowerCase())) { + if (isMethodWithLambdaInName(method.name.lowercase())) { return false } } diff --git a/core/src/main/java/com/github/grishberg/profiler/plugins/stages/methods/StagesAnalyzerLogic.kt b/core/src/main/java/com/github/grishberg/profiler/plugins/stages/methods/StagesAnalyzerLogic.kt index 1bf7589..b7846ce 100644 --- a/core/src/main/java/com/github/grishberg/profiler/plugins/stages/methods/StagesAnalyzerLogic.kt +++ b/core/src/main/java/com/github/grishberg/profiler/plugins/stages/methods/StagesAnalyzerLogic.kt @@ -148,7 +148,7 @@ class StagesAnalyzerLogic( if (userSelection == JFileChooser.APPROVE_OPTION) { var fileToSave = fileChooser.selectedFile - if (fileToSave.extension.toLowerCase() != "json") { + if (fileToSave.extension.lowercase() != "json") { fileToSave = File(fileToSave.absolutePath + ".json") } settings.stagesFileDialogDir = fileToSave.parent @@ -171,7 +171,7 @@ class StagesAnalyzerLogic( val userSelection = fileChooser.showSaveDialog(ui) if (userSelection == JFileChooser.APPROVE_OPTION) { var fileToSave = fileChooser.selectedFile - if (fileToSave.extension.toLowerCase() != "txt") { + if (fileToSave.extension.lowercase() != "txt") { fileToSave = File(fileToSave.absolutePath + ".txt") logger.d("$TAG: Saving analyze result info int file '$fileToSave'") generate(fileToSave, cachedResult) diff --git a/core/src/main/java/com/github/grishberg/profiler/ui/dialogs/ReportsGeneratorDialog.kt b/core/src/main/java/com/github/grishberg/profiler/ui/dialogs/ReportsGeneratorDialog.kt index a38b957..5df1aae 100644 --- a/core/src/main/java/com/github/grishberg/profiler/ui/dialogs/ReportsGeneratorDialog.kt +++ b/core/src/main/java/com/github/grishberg/profiler/ui/dialogs/ReportsGeneratorDialog.kt @@ -102,7 +102,7 @@ class ReportsGeneratorDialog( if (userSelection == JFileChooser.APPROVE_OPTION) { var fileToSave = fileChooser.selectedFile - if (fileToSave.extension.toLowerCase() != "txt") { + if (fileToSave.extension.lowercase() != "txt") { fileToSave = File(fileToSave.absolutePath + ".txt") } settings.reportsFileDialogDir = fileToSave.parent diff --git a/core/src/main/java/com/github/grishberg/profiler/ui/dialogs/info/DependenciesDialogLogic.kt b/core/src/main/java/com/github/grishberg/profiler/ui/dialogs/info/DependenciesDialogLogic.kt index 0766909..b12692e 100644 --- a/core/src/main/java/com/github/grishberg/profiler/ui/dialogs/info/DependenciesDialogLogic.kt +++ b/core/src/main/java/com/github/grishberg/profiler/ui/dialogs/info/DependenciesDialogLogic.kt @@ -52,7 +52,7 @@ class DependenciesDialogLogic( val userSelection = fileChooser.showSaveDialog(dialog) if (userSelection == JFileChooser.APPROVE_OPTION) { var fileToSave = fileChooser.selectedFile - if (fileToSave.extension.toLowerCase() != "txt") { + if (fileToSave.extension.lowercase() != "txt") { fileToSave = File(fileToSave.absolutePath + ".txt") settings.reportsFileDialogDir = fileToSave.parent logger.d("$TAG: Saving methods info int file '$fileToSave'") diff --git a/gradle.properties b/gradle.properties index 0fa73ef..df33612 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,16 +8,18 @@ studioCompilePath=/Applications/Android Studio.app/Contents pluginGroup = com.github.grishberg pluginName = android-methods-profiler -yampVersion = 25.02.18 +yampVersion = 25.08.03 # See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html # for insight into build numbers and IntelliJ Platform versions. -pluginSinceBuild = 223 -pluginUntilBuild = 243.* +#TODO: set to 252.* +sinceBuild=243.22562.145 # IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties platformType = AI -platformVersion = 2024.1.1.1 +#TODO: set to 2025.1.1.2 +platformVersion=2024.3.1.7 +androidPluginVersion=243.22562.218 # Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html # Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 87b738c..ccebba7 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 41dfb87..18362b7 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip +networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts index 83a9cf7..f490b30 100644 --- a/plugin/build.gradle.kts +++ b/plugin/build.gradle.kts @@ -1,12 +1,14 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget + plugins { // Java support id("java") // Kotlin support - id("org.jetbrains.kotlin.jvm") - // Gradle IntelliJ Plugin - id("org.jetbrains.intellij") version "1.13.3" - // Gradle Changelog Plugin - id("org.jetbrains.changelog") version "1.3.1" + id("org.jetbrains.kotlin.jvm") version "2.1.0" + // https://github.com/JetBrains/intellij-platform-gradle-plugin + id("org.jetbrains.intellij.platform") version "2.6.0" + // https://github.com/JetBrains/gradle-changelog-plugin + id("org.jetbrains.changelog") version "2.2.1" } fun properties(key: String) = project.findProperty(key).toString() @@ -14,21 +16,49 @@ fun properties(key: String) = project.findProperty(key).toString() group = properties("pluginGroup") version = properties("yampVersion") -// Configure project's dependencies +// Configure Java compatibility +java { + toolchain { + languageVersion.set(JavaLanguageVersion.of(21)) + } + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 +} + +kotlin { + jvmToolchain { + languageVersion.set(JavaLanguageVersion.of(21)) + } +} + repositories { mavenCentral() + google() + intellijPlatform { defaultRepositories() } } -intellij { - pluginName.set("plugin_".plus(properties("pluginName"))) - version.set(properties("platformVersion")) - type.set(properties("platformType")) - // Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file. - plugins.set(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty)) +intellijPlatform { + pluginConfiguration { + name = properties("pluginName") + group = properties("pluginGroup") + changeNotes.set("Updated android studio compatibility to 2024.3.1.7") + ideaVersion.sinceBuild.set(project.property("sinceBuild").toString()) + ideaVersion.untilBuild.set(provider { null }) + } + buildSearchableOptions.set(false) + instrumentCode = true } dependencies { + intellijPlatform { + bundledPlugin("org.jetbrains.android") + if (project.hasProperty("localASVersion")) { + local(property("localASVersion").toString()) + } else { + androidStudio(property("platformVersion").toString()) + } + } implementation(project(":core")) implementation("com.github.Grigory-Rylov:adb-facade-core:0.1.8") implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") @@ -51,33 +81,18 @@ dependencies { testImplementation("junit:junit:4.12") } - tasks { - - patchPluginXml { - version.set(properties("yampVersion")) - sinceBuild.set(properties("pluginSinceBuild")) - untilBuild.set(properties("pluginUntilBuild")) - - changeNotes.set( - """ - Added extended search.
- """ + runIde { + jvmArgs = listOf( + "-Dide.mac.message.dialogs.as.sheets=false", + "-Djb.privacy.policy.text=", + "-Djb.consents.confirmation.enabled=false" ) } - // Configure UI tests plugin - // Read more: https://github.com/JetBrains/intellij-ui-test-robot - runIdeForUiTests { - systemProperty("robot-server.port", "8082") - systemProperty("ide.mac.message.dialogs.as.sheets", "false") - systemProperty("jb.privacy.policy.text", "") - systemProperty("jb.consents.confirmation.enabled", "false") - } - - runIde { - // Absolute path to installed target 3.5 Android Studio to use as - // IDE Development Instance (the "Contents" directory is macOS specific): - ideDir.set(file("/Applications/Android Studio.app/Contents")) + withType().configureEach { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_21) + } } } diff --git a/settings.gradle b/settings.gradle index 7549de5..f7d62f4 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,4 +1,12 @@ -rootProject.name = 'AndroidProfilerViewer' +pluginManagement { + repositories { + maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' } + gradlePluginPortal() + mavenCentral() + } +} + +rootProject.name = 'YAMP' include ':core' include ':plugin'