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
44 changes: 0 additions & 44 deletions build.gradle

This file was deleted.

21 changes: 21 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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())
}
}
29 changes: 0 additions & 29 deletions core/build.gradle

This file was deleted.

37 changes: 37 additions & 0 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'")
Expand Down
10 changes: 6 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
87 changes: 51 additions & 36 deletions plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,34 +1,64 @@
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()

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")
Expand All @@ -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.<br>
"""
runIde {
jvmArgs = listOf(
"-Dide.mac.message.dialogs.as.sheets=false",
"-Djb.privacy.policy.text=<!--999.999-->",
"-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", "<!--999.999-->")
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<org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile>().configureEach {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_21)
}
}
}
10 changes: 9 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Loading