Skip to content

Commit

Permalink
build:调整配置
Browse files Browse the repository at this point in the history
  • Loading branch information
Petterpx committed Jun 22, 2022
1 parent 6081b3b commit 514d95b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 34 deletions.
25 changes: 19 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '4.2.2' apply false
id 'com.android.library' version '4.2.2' apply false
id 'org.jetbrains.kotlin.android' version '1.5.31' apply false
id 'org.jetbrains.kotlin.jvm' version '1.5.31' apply false
// id 'com.xiachufang.manifest.exported' apply false
buildscript {
repositories {
google()
maven { url "https://jitpack.io" }
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31"
}
}

allprojects {
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
}


task clean(type: Delete) {
delete rootProject.buildDir
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.xiachufang.manifest.exported

import groovy.namespace.QName
import groovy.util.Node
import groovy.util.NodeList
import groovy.xml.XmlParser
import groovy.util.XmlParser
import groovy.xml.QName
import java.io.File
import java.io.PrintWriter
import org.gradle.api.DefaultTask
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class ExportedPlugin : Plugin<Project> {
val t = p.tasks.getByName(
String.format(
"process%sMainManifest",
it.capitalized()
it.capitalize()
)
) as ProcessApplicationManifest
val exportedTask =
Expand All @@ -56,15 +56,6 @@ class ExportedPlugin : Plugin<Project> {
}
}

@OptIn(ExperimentalStdlibApi::class)
private fun String.capitalized(): String {
return this.replaceFirstChar {
if (it.isLowerCase())
it.titlecase(Locale.getDefault())
else it.toString()
}
}

companion object {
private const val EXPORTED_EXT = "exported"
private const val TASK_NAME = "ManifestExportedTask"
Expand Down
16 changes: 0 additions & 16 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
pluginManagement {
repositories {
gradlePluginPortal()
google()
maven { url 'https://jitpack.io' }
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
repositories {
google()
maven { url 'https://jitpack.io' }
mavenCentral()
}
}
rootProject.name = "ManifestExportedPlugin"
include ':app'
include ':exported-plugin'
Expand Down

0 comments on commit 514d95b

Please sign in to comment.