From 73ae87c1b22823c1c3348a6292301aaf19133c68 Mon Sep 17 00:00:00 2001 From: mikrise2 <56760252+mikrise2@users.noreply.github.com> Date: Fri, 10 May 2024 18:02:37 +0200 Subject: [PATCH] [ML4SE-38] Fixed README, added properties (#104) --- .gitignore | 2 ++ README.md | 24 +++++++------ gradle.properties | 4 +-- ij-plugin/build.gradle.kts | 36 ++++++++++++++----- .../config/MainTaskTrackerConfig.kt | 4 ++- .../properties/default/domain.properties | 1 + 6 files changed, 48 insertions(+), 23 deletions(-) create mode 100644 ij-plugin/src/main/resources/properties/default/domain.properties diff --git a/.gitignore b/.gitignore index e2e5d94e..af0b1592 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ .idea .qodana build + +ij-plugin/src/main/resources/properties/actual diff --git a/README.md b/README.md index a93b8daf..c3a9f01e 100644 --- a/README.md +++ b/README.md @@ -8,17 +8,19 @@ code quality and other. This will allow us to conduct better studies, produce mo ux-studies and potentially speed up user-testing for experimental features. -We want to develop a plugin with the following functionality: - -- [ ] It will be able to ask small, singular, questions to user in popup window; -- [ ] It will be able to suggest users to participate in two types of studies: - - [ ] “Questionnaire” study – which will open questionnaire in side window of IDE& Questionnaire - in this case could be any web content, for example diary record or some attention experiment. - - [ ] “Task” study – which will open file inside ide with some task and will record the process of task solution - - [ ]“Replay” study – which will play a given set of actions in the IDE and users will be asked a few questions about it. -- [ ] It will be able to configure IDE in arbitrary pre-defined way; -- [ ] It will be able to suggest this task based on IDE logs – on given time or after a particular event. -- [ ] Send all resulting data to the remote server. + +The plugin is capable of collecting the following data: +- Snapshots of all code changes. +- All activities that occurred in the IDE. More details about activity types you can find [here](ij-plugin/src/main/kotlin/org/jetbrains/research/tasktracker/tracking/activity/ActivityEvent.kt). +- Switching between file windows. +- Switching between tool and IDE plugin windows. +- Survey responses. +- Third-party logs/files specified in the [configuration](ij-plugin/src/main/kotlin/org/jetbrains/research/tasktracker/config/content/PluginInfoConfig.kt) by this [structure](ij-plugin/src/main/kotlin/org/jetbrains/research/tasktracker/config/content/Log.kt). + + +The plugin works in conjunction with the [server](ij-server), which is located in the same repository. The server receives, processes, and saves the data that was sent from the plugin side. + +The settings of the plugin configuration and interaction with its server are stored [here](ij-plugin/src/main/resources/properties/actual). If this directory does not exist, it will be created with default properties and values. Here we want to notice that the plugin will not collect any of the user data outside given tasks. diff --git a/gradle.properties b/gradle.properties index 5ffa248d..314f7dc6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,10 +1,10 @@ # IntelliJ Platform Artifacts Repositories -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html pluginGroup = org.jetBrains.research.tasktracker -pluginName = tasktracker-3 +pluginName = TaskTracker-3 pluginRepositoryUrl = https://github.com/JetBrains-Research/tasktracker-3 # SemVer format -> https://semver.org -pluginVersion = 0.0.1 +pluginVersion = 0.1.0 # Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html pluginSinceBuild = 223 diff --git a/ij-plugin/build.gradle.kts b/ij-plugin/build.gradle.kts index 100f9a39..74c0e234 100644 --- a/ij-plugin/build.gradle.kts +++ b/ij-plugin/build.gradle.kts @@ -1,5 +1,6 @@ import io.gitlab.arturbosch.detekt.Detekt import org.jetbrains.changelog.markdownToHTML +import org.jetbrains.kotlin.incremental.createDirectory group = rootProject.group version = rootProject.version @@ -35,21 +36,38 @@ intellij { plugins.set(properties("platformPlugins").map { it.split(',').map(String::trim).filter(String::isNotEmpty) }) } +val defaultPropertiesDirectory = project.file("src/main/resources/properties/default") +val actualPropertiesDirectory = project.file("src/main/resources/properties/actual").also { if (!it.exists()) it.createDirectory() } + tasks { + val checkPropertiesExist = register("checkPropertiesExist") { + doLast { + defaultPropertiesDirectory.listFiles()?.forEach { file -> + val newFile = File("${actualPropertiesDirectory.absolutePath}/${file.name}") + if (!newFile.exists()) { + newFile.createNewFile() + newFile.writeText(file.readText()) + } + } + } + } + + configureEach { + if (name != checkPropertiesExist.name) { + dependsOn(checkPropertiesExist) + } + } + withType() .forEach { it.enabled = false } patchPluginXml { val description = """ - CodeMood – the revolutionary plugin that understands and affirms your emotions while you code! - - The plugin will ask you permission to record the coding session using one of available video devices. - _We don't send the photos to a server and handle them locally._ - During the session, you can click on the plugin icon to pop up a dashboard with - an emoticon reflecting the programmer's current emotion. - In the end of the coding session you might fill out a short survey about your feelings. - - **Download CodeMood today and start coding with emotions in harmony.** + TaskTracker-3 - a revolutionary plugin for collecting detailed data during education. + The plugin collects various user activities during interactions with it, such as code + snapshots with a certain granularity, all interactions with the interface, shortcuts, + and so on. Extensive configuration options with config files that control its entire + functionality make it very lightweight and easy to set up and use. """.trimIndent() pluginDescription.set(description.run { markdownToHTML(this) }) diff --git a/ij-plugin/src/main/kotlin/org/jetbrains/research/tasktracker/config/MainTaskTrackerConfig.kt b/ij-plugin/src/main/kotlin/org/jetbrains/research/tasktracker/config/MainTaskTrackerConfig.kt index 90e710bc..848912a9 100644 --- a/ij-plugin/src/main/kotlin/org/jetbrains/research/tasktracker/config/MainTaskTrackerConfig.kt +++ b/ij-plugin/src/main/kotlin/org/jetbrains/research/tasktracker/config/MainTaskTrackerConfig.kt @@ -17,6 +17,7 @@ import org.jetbrains.research.tasktracker.config.tracking.WebCamTrackingConfig import org.jetbrains.research.tasktracker.config.util.buildBaseConfig import org.jetbrains.research.tasktracker.properties.PluginProperties import java.io.File +import java.util.* /** * Plugin's main config. Initializes and stores configs of all subsystems. @@ -60,7 +61,8 @@ data class MainTaskTrackerConfig( val agreementFilePath = "$pluginFolderPath/agreement/agreement.json" val logFilesFolder = "$pluginFolderPath/logs" const val PLUGIN_PROPERTIES_FILE = "$PLUGIN_NAME.properties" - private const val DOMAIN = "https://tt-server-5.labs.jb.gg" + private val DOMAIN = ResourceBundle.getBundle("properties.actual.domain") + .getString("serverAddress") fun getRoute(path: String) = "$DOMAIN/$path" diff --git a/ij-plugin/src/main/resources/properties/default/domain.properties b/ij-plugin/src/main/resources/properties/default/domain.properties new file mode 100644 index 00000000..2aefe233 --- /dev/null +++ b/ij-plugin/src/main/resources/properties/default/domain.properties @@ -0,0 +1 @@ +serverAddress=http://0.0.0.0:8080