Skip to content
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
10 changes: 2 additions & 8 deletions .github/workflows/build-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,12 @@ jobs:

- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.get_version.outputs.version }}
name: Release v${{ steps.get_version.outputs.version }}
draft: false
prerelease: false

- name: Upload plugin artifact to release
uses: softprops/action-gh-release@v1
with:
files: plugin/build/distributions/yamp_plugin_${{ steps.get_version.outputs.version }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
files: plugin/build/distributions/yamp_plugin_${{ steps.get_version.outputs.version }}.zip # ← добавь сюда!
29 changes: 13 additions & 16 deletions .github/workflows/pr_master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,31 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4 # ← v4

- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4 # ← v4
with:
java-version: '17'
distribution: 'temurin'

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
uses: gradle/wrapper-validation-action@v3 # ← тег v3

- name: Build with Gradle
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1

with:
uses: gradle/gradle-build-action@v3 # ← тег v3
with: # ← правильно!
arguments: fatJar

- name : Retrieve Version
- name: Retrieve Version
id: yamp_version # ← id сюда!
run: |
echo "::set-output name=VERSION_NAME::$(${{github.workspace}}/gradlew -q printVersionName)"
id: yamp_version

- name: Get version
run:
echo "version_name=${{steps.yamp_version.outputs.VERSION_NAME}}" >> $GITHUB_ENV
echo "version_name=$(${{github.workspace}}/gradlew -q printVersionName)" >> $GITHUB_OUTPUT # GITHUB_OUTPUT!

- run: echo ${{env.version_name}}
- name: Print version
run: echo ${{ steps.yamp_version.outputs.version_name }}

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4 # ← v4!
with:
name: yamp-${{env.version_name}}
name: yamp-${{ steps.yamp_version.outputs.version_name }}
path: app/build/libs
92 changes: 0 additions & 92 deletions app/build.gradle

This file was deleted.

95 changes: 95 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
import org.gradle.internal.os.OperatingSystem
import org.gradle.api.tasks.bundling.Jar
import org.gradle.process.ExecOperations

plugins {
java
kotlin("jvm")
}

val properties: (String) -> String = { key ->
project.findProperty(key).toString()
}

group = properties("pluginGroup")
version = properties("yampVersion")

configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_17
}

sourceSets {
main {
java {
if (OperatingSystem.current().isMacOsX) {
srcDir("src/mac/java")
} else {
srcDir("src/default/java")
}
}
}
}

repositories {
mavenCentral()
}

dependencies {
implementation(project(":core"))
implementation("com.github.Grigory-Rylov:adb-facade-core:0.1.8")
implementation("com.github.Grigory-Rylov:adb-facade-ddmlib:0.1.2")
implementation("com.github.Grigory-Rylov:andoid_method_trace_recorder:2.1.0")
implementation("com.github.Grishberg:tree-table:0.1.1")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.2")
implementation("com.android.tools.ddms:ddmlib:26.6.3")
implementation("com.google.code.gson:gson:2.8.6")
implementation("org.slf4j:slf4j-api:1.7.25")
implementation("org.slf4j:slf4j-log4j12:1.7.25")
implementation("log4j:log4j:1.2.17")

testImplementation("junit:junit:4.12")
testImplementation("org.mockito:mockito-core:2.23.0")
testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.3.2")
}

tasks.withType<JavaCompile> {
options.compilerArgs.add("-XDignore.symbol.file=true")
}

tasks.register<Jar>("fatJar") {
manifest {
attributes(
"Main-Class" to "com.github.grishberg.profiler.Launcher",
"Implementation-Title" to "Android Methods Profiler",
"Implementation-Version" to archiveVersion
)
}

duplicatesStrategy = DuplicatesStrategy.EXCLUDE

archiveBaseName.set("yamp")

from(configurations.runtimeClasspath.get().map {
if (it.isDirectory) it else zipTree(it)
}) {
exclude("MaterialUISwingDemo*.class")
exclude("module-info.class")
}

with(tasks.jar.get())
}

val installerScript = when {
OperatingSystem.current().isLinux -> "build_scripts/linuxApplication"
OperatingSystem.current().isWindows -> ""
OperatingSystem.current().isMacOsX -> "build_scripts/macosx.sh"
else -> ""
}

tasks.register<Exec>("buildInstaller") {
dependsOn("fatJar")
workingDir(file("."))
println("Current WD: ${workingDir}")
commandLine("./$installerScript", version.toString())
}
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,7 @@ class JsonSettings(
var outputStream: FileOutputStream? = null
try {
outputStream = FileOutputStream(settingsFile)
val bufferedWriter: BufferedWriter
bufferedWriter = BufferedWriter(OutputStreamWriter(outputStream, "UTF-8"))
val bufferedWriter = BufferedWriter(OutputStreamWriter(outputStream, "UTF-8"))
gson.toJson(settingsMap, bufferedWriter)
bufferedWriter.close()
log.d("$TAG settings are saved")
Expand All @@ -227,16 +226,16 @@ class JsonSettings(
setStringList(SETTINGS_HISTORY, value)
}

override var packageName: String
get() = getStringValueOrDefault(PKG_NAME_SETTINGS, "")
override var packageNames: List<String>
get() = getStringList(PKG_NAME_SETTINGS)
set(value) {
setStringValue(PKG_NAME_SETTINGS, value)
setStringList(PKG_NAME_SETTINGS, value)
}

override var activityName: String
get() = getStringValueOrDefault(ACTIVITY_NAME_SETTINGS, "")
override var activityNames: List<String>
get() = getStringList(ACTIVITY_NAME_SETTINGS)
set(value) {
setStringValue(ACTIVITY_NAME_SETTINGS, value)
setStringList(ACTIVITY_NAME_SETTINGS, value)
}

override var sampling: Int
Expand All @@ -257,10 +256,10 @@ class JsonSettings(
setIntValue(PROFILER_BUFFER_SIZE_SETTINGS, value)
}

override var fileNamePrefix: String
get() = getStringValueOrDefault(FILE_NAME_PREFIX_SETTINGS, "")
override var fileNamePrefixes: List<String>
get() = getStringList(FILE_NAME_PREFIX_SETTINGS)
set(value) {
setStringValue(FILE_NAME_PREFIX_SETTINGS, value)
setStringList(FILE_NAME_PREFIX_SETTINGS, value)
}

override var systraceStagePrefix: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import javax.swing.WindowConstants
import javax.swing.border.BevelBorder
import javax.swing.border.EmptyBorder
import javax.swing.border.EtchedBorder
import com.github.grishberg.profiler.ui.views.HistoryComboBox

private const val TAG = "JavaMethodsRecorderDialog"
private const val TEXT_PADDING = 8
Expand All @@ -48,9 +49,9 @@ class JavaMethodsRecorderDialog(
owner,
TITLE, true
), JavaMethodsRecorderDialogView {
private val packageNameField: JTextField
private val activityNameField: JTextField
private val fileNamePrefixField: JTextField
private val packageNameField: HistoryComboBox
private val activityNameField: HistoryComboBox
private val fileNamePrefixField: HistoryComboBox
private val remoteDeviceAddressField: JTextField = JTextField(20)
private val stagesTracePrefixField: JTextField = JTextField(10)
private val showRemotePanelCheckbox = JCheckBox("Connect to remote device")
Expand All @@ -71,23 +72,14 @@ class JavaMethodsRecorderDialog(
private val recordModeComBox =
JComboBox(arrayOf(RecordMode.METHOD_SAMPLE, RecordMode.METHOD_TRACES))

override var packageName: String
get() = packageNameField.text.trim()
set(value) {
packageNameField.text = value
}
override val packageName: String
get() = packageNameField.text

override var activityName: String
get() = activityNameField.text.trim()
set(value) {
activityNameField.text = value
}
override val activityName: String
get() = activityNameField.text

override var fileNamePrefix: String
get() = fileNamePrefixField.text.trim()
set(value) {
fileNamePrefixField.text = value
}
override val fileNamePrefix: String
get() = fileNamePrefixField.text

override var sampling: Int
get() = samplingField.value
Expand Down Expand Up @@ -150,13 +142,17 @@ class JavaMethodsRecorderDialog(
val contentPanel = JPanel()
contentPanel.layout = BorderLayout()

packageNameField = JTextField(FIELD_LENGTH)
packageNameField = HistoryComboBox.create()
packageNameField.columns = FIELD_LENGTH
packageNameField.toolTipText = "Enter application package. Required"

activityNameField = JTextField(FIELD_LENGTH)
activityNameField = HistoryComboBox.create()
activityNameField.columns = FIELD_LENGTH

activityNameField.toolTipText = "Enter entry point activity. Optional"

fileNamePrefixField = JTextField(FIELD_LENGTH)
fileNamePrefixField = HistoryComboBox.create()
fileNamePrefixField.columns = FIELD_LENGTH
fileNamePrefixField.toolTipText = "Adds file name prefix. Optional."

val content = panelBuilder.content
Expand Down Expand Up @@ -249,6 +245,19 @@ class JavaMethodsRecorderDialog(
pack()
}

override fun setInitialPackageNames(names: List<String>) {
packageNameField.setItems(names)
}

override fun setInitialActivityNames(names: List<String>) {
activityNameField.setItems(names)
}

override fun setInitialFileNamePrefixes(names: List<String>) {
fileNamePrefixField.setItems(names)
}


private fun buildMoreOptionsPanel(): JPanel {
val panel = JPanel()
panel.layout = BorderLayout()
Expand Down
Loading
Loading