Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Intellij Community
Commits
4e4b957e
Commit
4e4b957e
authored
6 years ago
by
Anton Makeev
1
Browse files
Options
Download
Email Patches
Plain Diff
FUS-171 Report Maven settings statistics: add missing settings, report total maven users
parent
c97e3e9b
Branches unavailable
Tags unavailable
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenImportingSettings.java
+3
-1
.../jetbrains/idea/maven/project/MavenImportingSettings.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/statistics/MavenSettingsCollector.kt
+50
-8
...jetbrains/idea/maven/statistics/MavenSettingsCollector.kt
with
53 additions
and
9 deletions
+53
-9
plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenImportingSettings.java
+
3
-
1
View file @
4e4b957e
...
...
@@ -37,6 +37,8 @@ public class MavenImportingSettings implements Cloneable {
"generate-test-resources"
,
"process-test-resources"
};
public
static
final
String
UPDATE_FOLDERS_DEFAULT_PHASE
=
PROCESS_RESOURCES_PHASE
;
public
static
final
String
DEFAULT_DEPENDENCY_TYPES
=
"jar, test-jar, maven-plugin, ejb, ejb-client, jboss-har, jboss-sar, war, ear, bundle"
;
@NotNull
private
String
dedicatedModuleDir
=
""
;
private
boolean
lookForNested
=
false
;
...
...
@@ -56,7 +58,7 @@ public class MavenImportingSettings implements Cloneable {
private
GeneratedSourcesFolder
generatedSourcesFolder
=
GeneratedSourcesFolder
.
AUTODETECT
;
private
String
dependencyTypes
=
"jar, test-jar, maven-plugin, ejb, ejb-client, jboss-har, jboss-sar, war, ear, bundle"
;
private
String
dependencyTypes
=
DEFAULT_DEPENDENCY_TYPES
;
private
Set
<
String
>
myDependencyTypesAsSet
;
@NotNull
private
String
vmOptionsForImporter
=
""
;
...
...
This diff is collapsed.
Click to expand it.
plugins/maven/src/main/java/org/jetbrains/idea/maven/statistics/MavenSettingsCollector.kt
+
50
-
8
View file @
4e4b957e
...
...
@@ -5,9 +5,12 @@ import com.intellij.internal.statistic.beans.UsageDescriptor
import
com.intellij.internal.statistic.service.fus.collectors.ProjectUsagesCollector
import
com.intellij.internal.statistic.utils.getBooleanUsage
import
com.intellij.internal.statistic.utils.getEnumUsage
import
com.intellij.openapi.project.ExternalStorageConfigurationManager
import
com.intellij.openapi.project.Project
import
org.jetbrains.idea.maven.execution.MavenExternalParameters.resolveMavenHome
import
org.jetbrains.idea.maven.execution.MavenRunner
import
org.jetbrains.idea.maven.execution.MavenRunnerSettings
import
org.jetbrains.idea.maven.project.MavenImportingSettings
import
org.jetbrains.idea.maven.project.MavenProjectsManager
import
org.jetbrains.idea.maven.utils.MavenUtil
...
...
@@ -19,6 +22,11 @@ class MavenSettingsCollector : ProjectUsagesCollector() {
if
(!
manager
.
isMavenizedProject
)
return
emptySet
()
val
usages
=
mutableSetOf
<
UsageDescriptor
>()
// to have a total users base line to calculate pertentages of settings
usages
.
add
(
getBooleanUsage
(
"hasMavenProject"
,
true
))
// Main page
val
generalSettings
=
manager
.
generalSettings
usages
.
add
(
getEnumUsage
(
"checksumPolicy"
,
generalSettings
.
checksumPolicy
))
usages
.
add
(
getEnumUsage
(
"failureBehavior"
,
generalSettings
.
failureBehavior
))
...
...
@@ -37,25 +45,59 @@ class MavenSettingsCollector : ProjectUsagesCollector() {
catch
(
ignore
:
Exception
)
{
// ignore invalid maven home configuration
}
usages
.
add
(
getBooleanUsage
(
"localRepository"
,
generalSettings
.
localRepository
.
isNotBlank
()))
usages
.
add
(
getBooleanUsage
(
"userSettingsFile"
,
generalSettings
.
userSettingsFile
.
isNotBlank
()))
// Importing page
val
importingSettings
=
manager
.
importingSettings
usages
.
add
(
getEnumUsage
(
"generatedSourcesFolder"
,
importingSettings
.
generatedSourcesFolder
))
usages
.
add
(
getBooleanUsage
(
"createModuleGroups"
,
importingSettings
.
isCreateModuleGroups
))
usages
.
add
(
getBooleanUsage
(
"createModulesForAggregators"
,
importingSettings
.
isCreateModulesForAggregators
))
usages
.
add
(
getBooleanUsage
(
"downloadDocsAutomatically"
,
importingSettings
.
isDownloadDocsAutomatically
))
usages
.
add
(
getBooleanUsage
(
"downloadSourcesAutomatically"
,
importingSettings
.
isDownloadSourcesAutomatically
))
usages
.
add
(
getBooleanUsage
(
"excludeTargetFolder"
,
importingSettings
.
isExcludeTargetFolder
))
usages
.
add
(
getBooleanUsage
(
"lookForNested"
,
importingSettings
.
isLookForNested
))
usages
.
add
(
getBooleanUsage
(
"dedicatedModuleDir"
,
importingSettings
.
dedicatedModuleDir
.
isNotBlank
()))
usages
.
add
(
getBooleanUsage
(
"storeProjectFilesExternally"
,
ExternalStorageConfigurationManager
.
getInstance
(
project
).
isEnabled
))
usages
.
add
(
getBooleanUsage
(
"importAutomatically"
,
importingSettings
.
isImportAutomatically
))
usages
.
add
(
getBooleanUsage
(
"autoDetectCompiler"
,
importingSettings
.
isAutoDetectCompiler
))
usages
.
add
(
getBooleanUsage
(
"createModulesForAggregators"
,
importingSettings
.
isCreateModulesForAggregators
))
usages
.
add
(
getBooleanUsage
(
"createModuleGroups"
,
importingSettings
.
isCreateModuleGroups
))
usages
.
add
(
getBooleanUsage
(
"keepSourceFolders"
,
importingSettings
.
isKeepSourceFolders
))
usages
.
add
(
getBooleanUsage
(
"
lookForNested
"
,
importingSettings
.
is
LookForNested
))
usages
.
add
(
getBooleanUsage
(
"
excludeTargetFolder
"
,
importingSettings
.
is
ExcludeTargetFolder
))
usages
.
add
(
getBooleanUsage
(
"useMavenOutput"
,
importingSettings
.
isUseMavenOutput
))
usages
.
add
(
getEnumUsage
(
"generatedSourcesFolder"
,
importingSettings
.
generatedSourcesFolder
))
usages
.
add
(
UsageDescriptor
(
"updateFoldersOnImportPhase."
+
importingSettings
.
updateFoldersOnImportPhase
))
usages
.
add
(
getBooleanUsage
(
"downloadDocsAutomatically"
,
importingSettings
.
isDownloadDocsAutomatically
))
usages
.
add
(
getBooleanUsage
(
"downloadSourcesAutomatically"
,
importingSettings
.
isDownloadSourcesAutomatically
))
usages
.
add
(
getBooleanUsage
(
"customDependencyTypes"
,
MavenImportingSettings
.
DEFAULT_DEPENDENCY_TYPES
!=
importingSettings
.
dependencyTypes
))
usages
.
add
(
getJREUsage
(
"jdkForImporter"
,
importingSettings
.
jdkForImporter
))
usages
.
add
(
getBooleanUsage
(
"hasVmOptionsForImporter"
,
importingSettings
.
vmOptionsForImporter
.
isNotBlank
()))
// Ignored Files page
usages
.
add
(
getBooleanUsage
(
"hasIgnoredFiles"
,
manager
.
ignoredFilesPaths
.
isNotEmpty
()))
usages
.
add
(
getBooleanUsage
(
"hasIgnoredPatterns"
,
manager
.
ignoredFilesPatterns
.
isNotEmpty
()))
// Runner page
val
runnerSettings
=
MavenRunner
.
getInstance
(
project
).
settings
usages
.
add
(
getBooleanUsage
(
"delegateBuildRun"
,
runnerSettings
.
isDelegateBuildToMaven
));
usages
.
add
(
getBooleanUsage
(
"passParentEnv"
,
runnerSettings
.
isPassParentEnv
));
usages
.
add
(
getBooleanUsage
(
"runMavenInBackground"
,
runnerSettings
.
isRunMavenInBackground
));
usages
.
add
(
getJREUsage
(
"runnerJreName"
,
runnerSettings
.
jreName
));
usages
.
add
(
getBooleanUsage
(
"hasRunnerVmOptions"
,
runnerSettings
.
vmOptions
.
isNotBlank
()));
usages
.
add
(
getBooleanUsage
(
"hasRunnerEnvVariables"
,
!
runnerSettings
.
environmentProperties
.
isNullOrEmpty
()));
usages
.
add
(
getBooleanUsage
(
"passParentEnv"
,
runnerSettings
.
isPassParentEnv
));
usages
.
add
(
getBooleanUsage
(
"skipTests"
,
runnerSettings
.
isSkipTests
));
usages
.
add
(
getBooleanUsage
(
"hasRunnerMavenProperties"
,
!
runnerSettings
.
mavenProperties
.
isNullOrEmpty
()));
return
usages
}
private
fun
getJREUsage
(
key
:
String
,
jreName
:
String
?):
UsageDescriptor
{
val
anonymizedName
=
when
{
jreName
.
isNullOrBlank
()
->
"empty"
jreName
in
listOf
(
MavenRunnerSettings
.
USE_INTERNAL_JAVA
,
MavenRunnerSettings
.
USE_PROJECT_JDK
,
MavenRunnerSettings
.
USE_JAVA_HOME
)
->
jreName
else
->
"custom"
}
return
UsageDescriptor
(
"$key.$anonymizedName"
,
1
)
}
}
This diff is collapsed.
Click to expand it.
小 白蛋
@baidan
mentioned in commit
630876af
·
2 years ago
mentioned in commit
630876af
mentioned in commit 630876afd02112ae6b6d9c666a768bf6ce6d8fb9
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help