Commit 450c3010 by 万齐军

home 改造

parent add82e9f
......@@ -3,7 +3,7 @@ apply from: "config.gradle"
buildscript {
ext {
kotlin_version = '1.3.50'
kotlin_version = '1.5.10'
support_version = '26.1.0'
minSdkVersion = 21
targetSdkVersion = 28
......@@ -29,10 +29,8 @@ buildscript {
// maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.android.tools.build:gradle:4.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.ydl.plugins:modular:1.0.3'
classpath 'com.ydl:notracepoint-gradle-plugin:0.0.3'
}
}
......@@ -88,27 +86,3 @@ subprojects {
}
}
}
apply plugin: 'modular-plugin'
modular {
compileSdkVersion 28
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
repositories {
maven {
url 'http://nexus.yidianling.com/repository/AndroidReleases/'
credentials {
username "admin"
password "fjoi#1+#@"
}
}
}
}
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
......@@ -3,6 +3,8 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply from: "../maven_push_home.gradle"
kapt {
arguments {
arg("AROUTER_MODULE_NAME", project.getName())
......
modular {
//模块包名
packageName "com.yidianling.home"
// 模块发布需要的参数
publish {
modules {
xlzx {
groupId = "com.ydl"
artifactId = "m-home-module-xlzx"
// 上报的 心理咨询 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
ydl{
groupId = "com.ydl"
artifactId = "m-home-module-ydl"
// 上报的 壹点灵 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
}
api {
// 壹点灵/心理咨询 业务模块 API层 jar包的发布信息
groupId = "com.ydl"
artifactId = "m-home-api"
//开发时注释掉版本号,发布api时打开
version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
// API 层打包时需要引入的依赖
apiDependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.fragment:fragment-ktx:1.2.4'
implementation "com.google.code.gson:gson:2.8.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.alibaba:arouter-api:1.4.1'
}
}
}
}
\ No newline at end of file
apply plugin: 'maven-publish'
def mavenRepositoryUrl = "http://nexus.yidianling.com/repository/AndroidReleases/"
def getVersionName() {
return "0.0.0"//0rootProject.ext.componentVersion
// return hasProperty('VERSION_NAME') ? VERSION_NAME : rootProject.ext.ydlPublishVersion[project.getName()]
}
def pVersion = "0.0.0"//rootProject.ext.componentVersion
def sourceJar(String name, String path) {
return project.tasks.create("source${name.capitalize()}Jar", Jar) {
group = "publishing"
description = "package ${name} source to jar"
from "$path/src/main/java"
from "$path/src/main/kotlin"
destinationDir = file("$path/build/libs/")
classifier = 'sources'
}
}
def setScm(scm) {
// scm.appendNode('connection', "https://github.com/${System.getenv("GITHUB_ACTOR")}/Shadow.git")
//
// def commit
// if ("${System.env.CI}".equalsIgnoreCase("true")) {
// commit = System.getenv("GITHUB_SHA")
// } else {
// commit = gitShortRev()
// }
// scm.appendNode('url', "https://github.com/${System.getenv("GITHUB_ACTOR")}/Shadow/commit/$commit")
}
def modifyPom = {
def root = asNode()
def dependencies = root.get('dependencies').first()
def children = dependencies.children()
for (def child : children) {
def versionNode = child.get("version").first()
def childVersion = versionNode.value().first()
def groupIdText = child.get("groupId").first().value().first()
if (childVersion == "unspecified" && groupIdText.startsWith("com.ydl")) {
versionNode.setValue(pVersion)
}
}
}
afterEvaluate {
publishing {
publications {
if (project.name.startsWith("ydl-")||project.name.endsWith("-api")||project.name=="m-audioim") {
component(MavenPublication) {
version pVersion
from components.release
artifact sourceJar(getName(), "${project.projectDir}")
pom.withXml(modifyPom)
}
}
if (project.name.startsWith("m-")&&!project.name.endsWith("-api")&&project.name!="m-audioim") {
ydlComponent(MavenPublication) {
group 'com.ydl'
version pVersion
from components.ydlRelease
artifact sourceJar(getName(), "${project.projectDir}")
// pom.withXml(modifyPom)
}
xlzxComponent(MavenPublication) {
version pVersion
from components.xlzxRelease
artifact sourceJar(getName(), "${project.projectDir}")
pom.withXml(modifyPom)
}
}
}
repositories {
// mavenLocal()
maven {
url "${rootProject.projectDir}/aaaaa"//mavenLocal().url
}
}
}
}
\ No newline at end of file
......@@ -5,4 +5,4 @@ include ':app',
':m-consultant', ':m-muse', ':m-fm', ':m-tests', ":m-course",
":m-im",":m-dynamic","m-article","m-audioim","m-user", "m-confide"
include ':ydl-tuicore', ':api:confide', ':api:dynamic', ':api:fm', ':api:consultant',
':api:course', ':api:user', ':api:tests', ':api:im'
':api:course', ':api:user', ':api:tests', ':api:im',':api:home'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment