Compare commits
9 Commits
master
...
dev-mir-st
| Author | SHA1 | Date |
|---|---|---|
|
|
70928797a8 | |
|
|
a0d8946530 | |
|
|
1794e7c08e | |
|
|
8f49fe3ef7 | |
|
|
28c4106c87 | |
|
|
8ea8c71c83 | |
|
|
60d9cfc303 | |
|
|
97de2ee024 | |
|
|
e94916a858 |
|
|
@ -7,8 +7,7 @@ plugins {
|
||||||
|
|
||||||
// The kotlin-dsl plugin requires a repository to be declared
|
// The kotlin-dsl plugin requires a repository to be declared
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
maven ("https://nexus.mir/repository/maven-proxy-group/")
|
||||||
google()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
pluginManagement {
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
url = uri("https://nexus.mir/repository/maven-proxy-group/")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -19,7 +19,7 @@ abstract class ApiGeneratorPlugin : Plugin<Project> {
|
||||||
with(target) {
|
with(target) {
|
||||||
repositories {
|
repositories {
|
||||||
maven {
|
maven {
|
||||||
url = uri("https://maven.dev.touchin.ru")
|
url = uri("https://nexus.mir/repository/maven-proxy-group/")
|
||||||
metadataSources {
|
metadataSources {
|
||||||
artifact()
|
artifact()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,9 @@ class SwaggerApiGeneratorAndroidPlugin : Plugin<Project> {
|
||||||
const val GENERATOR_CONFIG = "swaggerCodegen"
|
const val GENERATOR_CONFIG = "swaggerCodegen"
|
||||||
const val GENERATOR_VERSION = "3.0.34"
|
const val GENERATOR_VERSION = "3.0.34"
|
||||||
const val TI_GENERATOR_CONFIG = "TIKotlin-swagger-codegen"
|
const val TI_GENERATOR_CONFIG = "TIKotlin-swagger-codegen"
|
||||||
const val TI_GENERATOR_VERSION = "1.0.0"
|
const val TI_GENERATOR_VERSION = "1.0.1"
|
||||||
const val GENERATOR_EXT_NAME = "swaggerApiGenerator"
|
const val GENERATOR_EXT_NAME = "swaggerApiGenerator"
|
||||||
const val MAVEN_URL = "https://maven.dev.touchin.ru"
|
const val MAVEN_URL = "https://nexus.mir/repository/maven-proxy-group/"
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun apply(target: Project) {
|
override fun apply(target: Project) {
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,9 @@ class StaticAnalysisAndroidPlugin : StaticAnalysisPlugin() {
|
||||||
project.tasks.register("staticAnalysis") {
|
project.tasks.register("staticAnalysis") {
|
||||||
setupStaticAnalysisTask(
|
setupStaticAnalysisTask(
|
||||||
linters = linters,
|
linters = linters,
|
||||||
buildVariant = applicationVariants.first { it.name.contains("Debug") }.name
|
buildVariant = applicationVariants
|
||||||
|
.map { it.name.toLowerCase() }
|
||||||
|
.first { it.contains("debug") }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -32,10 +34,14 @@ class StaticAnalysisAndroidPlugin : StaticAnalysisPlugin() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun createLinters(): List<Linter> = listOf(
|
override fun createLinters(extension: StaticAnalysisExtension): List<Linter> = mutableListOf<Linter>().apply {
|
||||||
DetektLinter(),
|
add(DetektLinter())
|
||||||
CpdLinter(),
|
if (extension.isCpdLinterEnabled) {
|
||||||
|
CpdLinter()
|
||||||
|
}
|
||||||
|
if (extension.isAndroidLinterEnabled) {
|
||||||
AndroidLinter()
|
AndroidLinter()
|
||||||
)
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ class StaticAnalysisBackendPlugin : StaticAnalysisPlugin() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun createLinters(): List<Linter> = listOf(
|
override fun createLinters(extension: StaticAnalysisExtension): List<Linter> = listOf(
|
||||||
CpdLinter(),
|
CpdLinter(),
|
||||||
DetektLinter()
|
DetektLinter()
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -2,5 +2,7 @@ package static_analysis.plugins
|
||||||
|
|
||||||
open class StaticAnalysisExtension(
|
open class StaticAnalysisExtension(
|
||||||
var excludes: String = "",
|
var excludes: String = "",
|
||||||
var buildScriptDir: String? = null
|
var buildScriptDir: String? = null,
|
||||||
|
var isCpdLinterEnabled: Boolean = true,
|
||||||
|
var isAndroidLinterEnabled: Boolean = false,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package static_analysis.plugins
|
package static_analysis.plugins
|
||||||
|
|
||||||
|
import org.gradle.api.Action
|
||||||
import org.gradle.api.Plugin
|
import org.gradle.api.Plugin
|
||||||
import org.gradle.api.Project
|
import org.gradle.api.Project
|
||||||
import org.gradle.api.Task
|
import org.gradle.api.Task
|
||||||
|
|
@ -24,9 +25,10 @@ abstract class StaticAnalysisPlugin : Plugin<Project> {
|
||||||
|
|
||||||
extensions.create<StaticAnalysisExtension>(STATIC_ANALYSIS_EXT_NAME)
|
extensions.create<StaticAnalysisExtension>(STATIC_ANALYSIS_EXT_NAME)
|
||||||
|
|
||||||
val linters = createLinters()
|
val initData: StaticAnalysisExtension = extensions.getByType()
|
||||||
|
val linters = createLinters(initData)
|
||||||
|
|
||||||
linters.forEach { it.setupForProject(target, extensions.getByType()) }
|
linters.forEach { it.setupForProject(target, initData) }
|
||||||
|
|
||||||
gradle.projectsEvaluated {
|
gradle.projectsEvaluated {
|
||||||
createStaticAnalysisTasks(target, linters)
|
createStaticAnalysisTasks(target, linters)
|
||||||
|
|
@ -39,7 +41,10 @@ abstract class StaticAnalysisPlugin : Plugin<Project> {
|
||||||
dependsOn(*(linters.map { it.getTaskNames(project, buildVariant) }.flatten().toTypedArray()))
|
dependsOn(*(linters.map { it.getTaskNames(project, buildVariant) }.flatten().toTypedArray()))
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract fun createLinters(): List<Linter>
|
abstract fun createLinters(extension: StaticAnalysisExtension): List<Linter>
|
||||||
abstract fun createStaticAnalysisTasks(project: Project, linters: List<Linter>)
|
abstract fun createStaticAnalysisTasks(project: Project, linters: List<Linter>)
|
||||||
|
|
||||||
|
fun Project.staticAnalysis(configure: Action<StaticAnalysisExtension>): Unit =
|
||||||
|
(this as org.gradle.api.plugins.ExtensionAware).extensions.configure(STATIC_ANALYSIS_EXT_NAME, configure)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
# https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/appgallerykit-getting-started-0000001055756858#section1448912915419
|
||||||
|
|
||||||
|
-ignorewarnings
|
||||||
|
-keepattributes *Annotation*
|
||||||
|
-keepattributes Exceptions
|
||||||
|
-keepattributes InnerClasses
|
||||||
|
-keepattributes Signature
|
||||||
|
-keepattributes SourceFile,LineNumberTable
|
||||||
|
-keep class com.huawei.hianalytics.**{*;}
|
||||||
|
-keep class com.huawei.updatesdk.**{*;}
|
||||||
|
-keep class com.huawei.hms.**{*;}
|
||||||
|
-keep interface com.huawei.hms.analytics.type.HAEventType{*;}
|
||||||
|
-keep interface com.huawei.hms.analytics.type.HAParamType{*;}
|
||||||
|
-keep class com.huawei.hms.analytics.HiAnalyticsInstance{*;}
|
||||||
|
-keep class com.huawei.hms.analytics.HiAnalytics{*;}
|
||||||
|
|
@ -64,7 +64,7 @@ complexity:
|
||||||
ignoreSingleWhenExpression: true
|
ignoreSingleWhenExpression: true
|
||||||
ignoreSimpleWhenEntries: true
|
ignoreSimpleWhenEntries: true
|
||||||
LabeledExpression:
|
LabeledExpression:
|
||||||
active: true
|
active: false
|
||||||
LargeClass:
|
LargeClass:
|
||||||
active: true
|
active: true
|
||||||
threshold: 800
|
threshold: 800
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue