Browse Source

添加 publish.gradle配置文件。

kaiweicai 2 years ago
parent
commit
4cee6e3b03

+ 174 - 0
library_base/proguard-rules.pro

@@ -0,0 +1,174 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
+
+# 代码混淆压缩比,在0~7之间,默认为5,一般不做修改
+-optimizationpasses 5
+# 混合时不使用大小写混合,混合后的类名为小写
+-dontusemixedcaseclassnames
+# 指定不去忽略非公共库的类
+-dontskipnonpubliclibraryclasses
+-dontoptimize
+# 这句话能够使我们的项目混淆后产生映射文件
+# 包含有类名->混淆后类名的映射关系
+-verbose
+-ignorewarnings
+# 指定不去忽略非公共库的类成员
+-dontskipnonpubliclibraryclassmembers
+# 指定混淆是采用的算法,后面的参数是一个过滤器
+# 这个过滤器是谷歌推荐的算法,一般不做更改
+-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
+
+# 保留java与js交互注解
+-keepattributes *Annotation*
+-keepattributes *JavascriptInterface*
+
+#保留JavascriptInterface中的方法
+-keepclassmembers class * {
+    @android.webkit.JavascriptInterface <methods>;
+}
+
+# 保留内部类
+-keepattributes Exceptions,InnerClasses
+
+# 保留泛型
+-keepattributes Signature
+
+-keep class kotlin.** { *; }
+-keep class kotlin.Metadata { *; }
+
+-dontwarn kotlin.**
+
+-keepclassmembers class **$WhenMappings {
+    <fields>;
+}
+-keepclassmembers class kotlin.Metadata {
+    public <methods>;
+}
+
+-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
+    static void checkParameterIsNotNull(java.lang.Object, java.lang.String);
+}
+
+-keepnames class * implements java.io.Serializable
+-keepclassmembers class * implements java.io.Serializable {
+   static final long serialVersionUID;
+   private static final java.io.ObjectStreamField[] serialPersistentFields;
+   !static !transient <fields>;
+   private void writeObject(java.io.ObjectOutputStream);
+   private void readObject(java.io.ObjectInputStream);
+   java.lang.Object writeReplace();
+   java.lang.Object readResolve();
+}
+
+-keepclassmembers class **.R$* {
+    public static <fields>;
+}
+-keep class **.R$* {
+ *;
+}
+
+-keep public class * extends android.app.Activity{
+	public <fields>;
+	public <methods>;
+}
+-keep public class * extends android.app.Application{
+	public <fields>;
+	public <methods>;
+}
+
+-keep public class * extends android.app.Service
+-keep public class * extends android.content.BroadcastReceiver
+-keep public class * extends android.content.ContentProvider
+-keep public class * extends android.app.backup.BackupAgentHelper
+-keep public class * extends android.preference.Preference
+
+
+
+
+-keepclassmembers enum * {
+    public static **[] values();
+    public static ** valueOf(java.lang.String);
+}
+
+-keepclasseswithmembers class * {
+	public <init>(android.content.Context, android.util.AttributeSet);
+}
+
+-keepclasseswithmembers class * {
+	public <init>(android.content.Context, android.util.AttributeSet, int);
+}
+
+-keepclasseswithmembernames class *{
+	native <methods>;
+}
+
+-keep class * implements android.os.Parcelable {
+  public static final android.os.Parcelable$Creator *;
+}
+
+-keepclasseswithmembers class * {
+    ... *JNI*(...);
+}
+
+-keepclasseswithmembernames class * {
+	... *JRI*(...);
+}
+
+-keep class **JNI* {*;}
+
+-keep class cn.yyxx.commsdk.base.constants.Constants{public <fields>; public <methods>;}
+-keep class cn.yyxx.commsdk.base.entity.**{public <fields>; public <methods>;}
+-keep class cn.yyxx.commsdk.base.internal.**{public <fields>; public <methods>;}
+-keep class cn.yyxx.commsdk.base.utils.**{public <fields>; public <methods>;}
+-keep class cn.yyxx.commsdk.Version{public <fields>; public <methods>;}
+-keep class cn.yyxx.commsdk.base.YYXXWelcomeActivity{public <fields>; public <methods>;}
+-keep class cn.yyxx.commsdk.base.YYXXCommSdk{public <fields>; public <methods>;}
+-keep class cn.yyxx.commsdk.base.YYXXApplication{public <fields>; public <methods>;}
+
+# support sdk
+-keep class cn.yyxx.support.**{*;}
+
+# msa sdk
+-keep class XI.**{*;}
+-keep class com.asus.**{*;}
+-keep class com.bun.**{*;}
+-keep class com.huawei.hms.ads.identifier.**{*;}
+-keep class com.samsung.android.deviceidservice.**{*;}
+-keep class com.netease.nis.sdkwrapper.** {*;}
+-keep class com.zui.**{*;}
+-keep class org.json.**{*;}
+
+# authsdk
+-keep class com.alibaba.**{*;}
+-keep class com.cmic.**{*;}
+-keep class com.mobile.**{*;}
+-keep class com.nirvana.**{*;}
+
+# mmkv
+-keep class com.tencent.mmkv.**{*;}
+
+# zap
+-keep class com.dolin.zap.**{*;}
+
+# v4-support
+-keep class android.support.**{*;}
+

+ 110 - 0
library_base/publish.gradle

@@ -0,0 +1,110 @@
+apply plugin: 'maven-publish'
+apply plugin: 'signing'
+
+ext {
+    PUBLISH_GROUP_ID = 'io.github.yyxxgame.sdk'
+    PUBLISH_ARTIFACT_ID = 'eyuancomm-sdk-ktx-comm'
+    PUBLISH_VERSION = '1.0.0-rc6'
+}
+
+Properties properties = new Properties()
+properties.load(project.rootProject.file('local.properties').newDataInputStream())
+
+def ossrhUsername = properties.getProperty("SonaType.user")
+def ossrhPassword = properties.getProperty("SonaType.pwd")
+
+task androidSourcesJar(type: Jar) {
+    archiveClassifier.set('source')
+    if (project.plugins.findPlugin('com.android.library')) {
+        from android.sourceSets.main.java.srcDirs
+    } else {
+        form sourceSets.main.java.srcDirs
+    }
+    exclude "**/R.class"
+    exclude "**/BuildConfig.class"
+}
+
+publishing {
+    publications {
+        release(MavenPublication) {
+            // The coordinates of the library, being set from variables that
+            // we'll set up in a moment
+            groupId PUBLISH_GROUP_ID
+            artifactId PUBLISH_ARTIFACT_ID
+            version PUBLISH_VERSION
+
+            // Two artifacts, the `aar` and the sources
+            artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")
+            artifact androidSourcesJar
+
+            // Self-explanatory metadata for the most part
+            pom {
+                name = "${PUBLISH_GROUP_ID}:${PUBLISH_ARTIFACT_ID}"
+                description = 'game comm sdk of eyuan'
+                // If your project has a dedicated site, use its URL here
+                url = 'https://github.com/yyxxgame'
+                licenses {
+                    license {
+                        // 协议类型,一般默认Apache License2.0的话不用改:
+                        name = 'The Apache License, Version 2.0'
+                        url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+                    }
+                }
+                developers {
+                    developer {
+                        id = 'yyxxgame'
+                        name = 'yyxxgame'
+                        email = 'developcentre@yyxxgame.com'
+                    }
+                }
+                // Version control info, if you're using GitHub, follow the format as seen here
+                scm {
+                    //修改成你的Git地址:
+                    connection = 'scm:git:gogs.yyxxgame.com:3000/Client/EYuanGameSdk-KTX.git'
+                    developerConnection = 'scm:git:ssh://gogs.yyxxgame.com:3000/Client/EYuanGameSdk-KTX.git'
+                    //分支地址:
+                    url = 'http://gogs.yyxxgame.com/Client/EYuanGameSdk-KTX'
+                }
+                // A slightly hacky fix so that your POM will include any transitive dependencies
+                // that your library builds upon
+                withXml {
+                    def dependenciesNode = asNode().appendNode('dependencies')
+                    for (def node : project.configurations.implementation.allDependencies) {
+                        if (node.group == "null" || node.name == "unspecified" || node.version == "null") {
+                            break
+                        }
+                        def dependencyNode = dependenciesNode.appendNode('dependency')
+                        dependencyNode.appendNode('groupId', node.group)
+                        dependencyNode.appendNode('artifactId', node.name)
+                        dependencyNode.appendNode('version', node.version)
+                    }
+                }
+            }
+        }
+    }
+    repositories {
+        // The repository to publish to, Sonatype/MavenCentral
+        maven {
+            // This is an arbitrary name, you may also use "mavencentral" or
+            // any other name that's descriptive for you
+            name = "mavencentral"
+
+            def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
+            def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
+            // You only need this if you want to publish snapshots, otherwise just set the URL
+            // to the release repo directly
+            url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
+
+            // The username and password we've fetched earlier
+            credentials {
+                username ossrhUsername
+                password ossrhPassword
+            }
+        }
+    }
+}
+signing {
+    sign publishing.publications
+}
+
+publishReleasePublicationToMavencentralRepository.dependsOn(assemble)

+ 123 - 0
library_channel/publish.gradle

@@ -0,0 +1,123 @@
+apply plugin: 'maven-publish'
+apply plugin: 'signing'
+
+ext {
+    PUBLISH_GROUP_ID = 'io.github.yyxxgame.sdk'
+    PUBLISH_ARTIFACT_ID = 'yyxx-comm-base'
+    PUBLISH_VERSION = '3.0.100'
+}
+
+
+ext["signing.keyId"] = ''
+ext["signing.password"] = ''
+ext["signing.secretKeyRingFile"] = ''
+ext["ossrhUsername"] = ''
+ext["ossrhPassword"] = ''
+
+
+
+Properties properties = new Properties()
+properties.load(project.rootProject.file('local.properties').newDataInputStream())
+properties.each { name, value ->
+    ext[name] = value
+}
+
+
+task androidSourcesJar(type: Jar) {
+    archiveClassifier.set('source')
+    if (project.plugins.findPlugin('com.android.library')) {
+        from android.sourceSets.main.java.srcDirs
+    } else {
+        form sourceSets.main.java.srcDirs
+    }
+    exclude "**/R.class"
+    exclude "**/BuildConfig.class"
+}
+
+publishing {
+    publications {
+        release(MavenPublication) {
+            // The coordinates of the library, being set from variables that
+            // we'll set up in a moment
+            groupId PUBLISH_GROUP_ID
+            artifactId PUBLISH_ARTIFACT_ID
+            version PUBLISH_VERSION
+
+            // Two artifacts, the `aar` and the sources
+
+
+
+            artifact("$buildDir/outputs/aar/$PUBLISH_ARTIFACT_ID" + "-" + "$PUBLISH_VERSION"+ ".aar")
+            artifact androidSourcesJar
+
+            // Self-explanatory metadata for the most part
+            pom {
+                name = "${PUBLISH_GROUP_ID}${PUBLISH_ARTIFACT_ID}"
+                description = 'game comm sdk of yyxx_comm'
+                // If your project has a dedicated site, use its URL here
+                url = 'https://github.com/yyxxgame'
+                licenses {
+                    license {
+                        // 协议类型,一般默认Apache License2.0的话不用改:
+                        name = 'The Apache License, Version 2.0'
+                        url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+                    }
+                }
+                developers {
+                    developer {
+                        id = 'yyxxgame'
+                        name = 'yyxxgame'
+                        email = 'developcentre@yyxxgame.com'
+                    }
+                }
+                // Version control info, if you're using GitHub, follow the format as seen here
+                scm {
+                    //修改成你的Git地址:
+                    connection = 'scm:git:gogs.yyxxgame.com:3000/Client/YYXXCommSdk.git'
+                    developerConnection = 'scm:git:ssh://gogs.yyxxgame.com:3000/Client/YYXXCommSdk.git'
+                    //分支地址:
+                    url = 'http://gogs.yyxxgame.com:3000/Client/YYXXCommSdk.git'
+                }
+                // A slightly hacky fix so that your POM will include any transitive dependencies
+                // that your library builds upon
+                withXml {
+                    def dependenciesNode = asNode().appendNode('dependencies')
+                    for (def node : project.configurations.implementation.allDependencies) {
+                        if (node.group == "null" || node.name == "unspecified" || node.version == "null") {
+                            break
+                        }
+                        def dependencyNode = dependenciesNode.appendNode('dependency')
+                        dependencyNode.appendNode('groupId', node.group)
+                        dependencyNode.appendNode('artifactId', node.name)
+                        dependencyNode.appendNode('version', node.version)
+                    }
+                }
+            }
+        }
+    }
+    repositories {
+        // The repository to publish to, Sonatype/MavenCentral
+        maven {
+            // This is an arbitrary name, you may also use "mavencentral" or
+            // any other name that's descriptive for you
+            name = "mavencentral"
+
+            def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
+            def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
+            // You only need this if you want to publish snapshots, otherwise just set the URL
+            // to the release repo directly
+            url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
+
+            // The username and password we've fetched earlier
+            credentials {
+                username ossrhUsername
+                password ossrhPassword
+            }
+        }
+    }
+}
+signing {
+    sign publishing.publications
+}
+
+publishReleasePublicationToMavencentralRepository.dependsOn(assemble)

+ 4 - 6
library_core/build.gradle

@@ -51,7 +51,7 @@ android {
 
 dependencies {
 
-    api project(':library_base')
+    compileOnly project(':library_base')
 }
 
 
@@ -59,7 +59,7 @@ android.libraryVariants.all { variant ->
     if (variant.buildType.name == 'release'){
         variant.outputs.all {
 
-            outputFileName = "$PUBLISH_ARTIFACT_ID$PUBLISH_VERSION" + ".aar"
+            outputFileName = "$PUBLISH_ARTIFACT_ID"+ "-" + "$PUBLISH_VERSION" + ".aar"
         }
     }else{
         variant.outputs.all {
@@ -70,11 +70,9 @@ android.libraryVariants.all { variant ->
 }
 
 
-ext {
 
-    PUBLISH_ARTIFACT_ID = 'yyxx_comm_core'
-    PUBLISH_VERSION = ':3.0.100'
-}
 
 
 apply from: 'buildJar.gradle'
+
+apply from: 'publish.gradle'

+ 123 - 0
library_core/publish.gradle

@@ -0,0 +1,123 @@
+apply plugin: 'maven-publish'
+apply plugin: 'signing'
+
+ext {
+    PUBLISH_GROUP_ID = 'io.github.yyxxgame.sdk'
+    PUBLISH_ARTIFACT_ID = 'yyxx-comm-channel'
+    PUBLISH_VERSION = '3.0.100'
+}
+
+
+ext["signing.keyId"] = ''
+ext["signing.password"] = ''
+ext["signing.secretKeyRingFile"] = ''
+ext["ossrhUsername"] = ''
+ext["ossrhPassword"] = ''
+
+
+
+Properties properties = new Properties()
+properties.load(project.rootProject.file('local.properties').newDataInputStream())
+properties.each { name, value ->
+    ext[name] = value
+}
+
+
+task androidSourcesJar(type: Jar) {
+    archiveClassifier.set('source')
+    if (project.plugins.findPlugin('com.android.library')) {
+        from android.sourceSets.main.java.srcDirs
+    } else {
+        form sourceSets.main.java.srcDirs
+    }
+    exclude "**/R.class"
+    exclude "**/BuildConfig.class"
+}
+
+publishing {
+    publications {
+        release(MavenPublication) {
+            // The coordinates of the library, being set from variables that
+            // we'll set up in a moment
+            groupId PUBLISH_GROUP_ID
+            artifactId PUBLISH_ARTIFACT_ID
+            version PUBLISH_VERSION
+
+            // Two artifacts, the `aar` and the sources
+
+
+
+            artifact("$buildDir/outputs/aar/$PUBLISH_ARTIFACT_ID" + "-" + "$PUBLISH_VERSION"+ ".aar")
+            artifact androidSourcesJar
+
+            // Self-explanatory metadata for the most part
+            pom {
+                name = "${PUBLISH_GROUP_ID}${PUBLISH_ARTIFACT_ID}"
+                description = 'game comm sdk of yyxx_comm'
+                // If your project has a dedicated site, use its URL here
+                url = 'https://github.com/yyxxgame'
+                licenses {
+                    license {
+                        // 协议类型,一般默认Apache License2.0的话不用改:
+                        name = 'The Apache License, Version 2.0'
+                        url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+                    }
+                }
+                developers {
+                    developer {
+                        id = 'yyxxgame'
+                        name = 'yyxxgame'
+                        email = 'developcentre@yyxxgame.com'
+                    }
+                }
+                // Version control info, if you're using GitHub, follow the format as seen here
+                scm {
+                    //修改成你的Git地址:
+                    connection = 'scm:git:gogs.yyxxgame.com:3000/Client/YYXXCommSdk.git'
+                    developerConnection = 'scm:git:ssh://gogs.yyxxgame.com:3000/Client/YYXXCommSdk.git'
+                    //分支地址:
+                    url = 'http://gogs.yyxxgame.com:3000/Client/YYXXCommSdk.git'
+                }
+                // A slightly hacky fix so that your POM will include any transitive dependencies
+                // that your library builds upon
+                withXml {
+                    def dependenciesNode = asNode().appendNode('dependencies')
+                    for (def node : project.configurations.implementation.allDependencies) {
+                        if (node.group == "null" || node.name == "unspecified" || node.version == "null") {
+                            break
+                        }
+                        def dependencyNode = dependenciesNode.appendNode('dependency')
+                        dependencyNode.appendNode('groupId', node.group)
+                        dependencyNode.appendNode('artifactId', node.name)
+                        dependencyNode.appendNode('version', node.version)
+                    }
+                }
+            }
+        }
+    }
+    repositories {
+        // The repository to publish to, Sonatype/MavenCentral
+        maven {
+            // This is an arbitrary name, you may also use "mavencentral" or
+            // any other name that's descriptive for you
+            name = "mavencentral"
+
+            def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
+            def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
+            // You only need this if you want to publish snapshots, otherwise just set the URL
+            // to the release repo directly
+            url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
+
+            // The username and password we've fetched earlier
+            credentials {
+                username ossrhUsername
+                password ossrhPassword
+            }
+        }
+    }
+}
+signing {
+    sign publishing.publications
+}
+
+publishReleasePublicationToMavencentralRepository.dependsOn(assemble)

+ 123 - 0
library_platform/hnqj/publish.gradle

@@ -0,0 +1,123 @@
+apply plugin: 'maven-publish'
+apply plugin: 'signing'
+
+ext {
+    PUBLISH_GROUP_ID = 'io.github.yyxxgame.sdk'
+    PUBLISH_ARTIFACT_ID = 'yyxx-comm-channel'
+    PUBLISH_VERSION = '3.0.100'
+}
+
+
+ext["signing.keyId"] = ''
+ext["signing.password"] = ''
+ext["signing.secretKeyRingFile"] = ''
+ext["ossrhUsername"] = ''
+ext["ossrhPassword"] = ''
+
+
+
+Properties properties = new Properties()
+properties.load(project.rootProject.file('local.properties').newDataInputStream())
+properties.each { name, value ->
+    ext[name] = value
+}
+
+
+task androidSourcesJar(type: Jar) {
+    archiveClassifier.set('source')
+    if (project.plugins.findPlugin('com.android.library')) {
+        from android.sourceSets.main.java.srcDirs
+    } else {
+        form sourceSets.main.java.srcDirs
+    }
+    exclude "**/R.class"
+    exclude "**/BuildConfig.class"
+}
+
+publishing {
+    publications {
+        release(MavenPublication) {
+            // The coordinates of the library, being set from variables that
+            // we'll set up in a moment
+            groupId PUBLISH_GROUP_ID
+            artifactId PUBLISH_ARTIFACT_ID
+            version PUBLISH_VERSION
+
+            // Two artifacts, the `aar` and the sources
+
+
+
+            artifact("$buildDir/outputs/aar/$PUBLISH_ARTIFACT_ID" + "-" + "$PUBLISH_VERSION"+ ".aar")
+            artifact androidSourcesJar
+
+            // Self-explanatory metadata for the most part
+            pom {
+                name = "${PUBLISH_GROUP_ID}${PUBLISH_ARTIFACT_ID}"
+                description = 'game comm sdk of yyxx_comm'
+                // If your project has a dedicated site, use its URL here
+                url = 'https://github.com/yyxxgame'
+                licenses {
+                    license {
+                        // 协议类型,一般默认Apache License2.0的话不用改:
+                        name = 'The Apache License, Version 2.0'
+                        url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+                    }
+                }
+                developers {
+                    developer {
+                        id = 'yyxxgame'
+                        name = 'yyxxgame'
+                        email = 'developcentre@yyxxgame.com'
+                    }
+                }
+                // Version control info, if you're using GitHub, follow the format as seen here
+                scm {
+                    //修改成你的Git地址:
+                    connection = 'scm:git:gogs.yyxxgame.com:3000/Client/YYXXCommSdk.git'
+                    developerConnection = 'scm:git:ssh://gogs.yyxxgame.com:3000/Client/YYXXCommSdk.git'
+                    //分支地址:
+                    url = 'http://gogs.yyxxgame.com:3000/Client/YYXXCommSdk.git'
+                }
+                // A slightly hacky fix so that your POM will include any transitive dependencies
+                // that your library builds upon
+                withXml {
+                    def dependenciesNode = asNode().appendNode('dependencies')
+                    for (def node : project.configurations.implementation.allDependencies) {
+                        if (node.group == "null" || node.name == "unspecified" || node.version == "null") {
+                            break
+                        }
+                        def dependencyNode = dependenciesNode.appendNode('dependency')
+                        dependencyNode.appendNode('groupId', node.group)
+                        dependencyNode.appendNode('artifactId', node.name)
+                        dependencyNode.appendNode('version', node.version)
+                    }
+                }
+            }
+        }
+    }
+    repositories {
+        // The repository to publish to, Sonatype/MavenCentral
+        maven {
+            // This is an arbitrary name, you may also use "mavencentral" or
+            // any other name that's descriptive for you
+            name = "mavencentral"
+
+            def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
+            def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
+            // You only need this if you want to publish snapshots, otherwise just set the URL
+            // to the release repo directly
+            url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
+
+            // The username and password we've fetched earlier
+            credentials {
+                username ossrhUsername
+                password ossrhPassword
+            }
+        }
+    }
+}
+signing {
+    sign publishing.publications
+}
+
+publishReleasePublicationToMavencentralRepository.dependsOn(assemble)

+ 123 - 0
library_platform/hnyy/publish.gradle

@@ -0,0 +1,123 @@
+apply plugin: 'maven-publish'
+apply plugin: 'signing'
+
+ext {
+    PUBLISH_GROUP_ID = 'io.github.yyxxgame.sdk'
+    PUBLISH_ARTIFACT_ID = 'yyxx-comm-platform-hnqj'
+    PUBLISH_VERSION = '3.0.100'
+}
+
+
+ext["signing.keyId"] = ''
+ext["signing.password"] = ''
+ext["signing.secretKeyRingFile"] = ''
+ext["ossrhUsername"] = ''
+ext["ossrhPassword"] = ''
+
+
+
+Properties properties = new Properties()
+properties.load(project.rootProject.file('local.properties').newDataInputStream())
+properties.each { name, value ->
+    ext[name] = value
+}
+
+
+task androidSourcesJar(type: Jar) {
+    archiveClassifier.set('source')
+    if (project.plugins.findPlugin('com.android.library')) {
+        from android.sourceSets.main.java.srcDirs
+    } else {
+        form sourceSets.main.java.srcDirs
+    }
+    exclude "**/R.class"
+    exclude "**/BuildConfig.class"
+}
+
+publishing {
+    publications {
+        release(MavenPublication) {
+            // The coordinates of the library, being set from variables that
+            // we'll set up in a moment
+            groupId PUBLISH_GROUP_ID
+            artifactId PUBLISH_ARTIFACT_ID
+            version PUBLISH_VERSION
+
+            // Two artifacts, the `aar` and the sources
+
+
+
+            artifact("$buildDir/outputs/aar/$PUBLISH_ARTIFACT_ID" + "-" + "$PUBLISH_VERSION"+ ".aar")
+            artifact androidSourcesJar
+
+            // Self-explanatory metadata for the most part
+            pom {
+                name = "${PUBLISH_GROUP_ID}${PUBLISH_ARTIFACT_ID}"
+                description = 'game comm sdk of yyxx_comm'
+                // If your project has a dedicated site, use its URL here
+                url = 'https://github.com/yyxxgame'
+                licenses {
+                    license {
+                        // 协议类型,一般默认Apache License2.0的话不用改:
+                        name = 'The Apache License, Version 2.0'
+                        url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+                    }
+                }
+                developers {
+                    developer {
+                        id = 'yyxxgame'
+                        name = 'yyxxgame'
+                        email = 'developcentre@yyxxgame.com'
+                    }
+                }
+                // Version control info, if you're using GitHub, follow the format as seen here
+                scm {
+                    //修改成你的Git地址:
+                    connection = 'scm:git:gogs.yyxxgame.com:3000/Client/YYXXCommSdk.git'
+                    developerConnection = 'scm:git:ssh://gogs.yyxxgame.com:3000/Client/YYXXCommSdk.git'
+                    //分支地址:
+                    url = 'http://gogs.yyxxgame.com:3000/Client/YYXXCommSdk.git'
+                }
+                // A slightly hacky fix so that your POM will include any transitive dependencies
+                // that your library builds upon
+                withXml {
+                    def dependenciesNode = asNode().appendNode('dependencies')
+                    for (def node : project.configurations.implementation.allDependencies) {
+                        if (node.group == "null" || node.name == "unspecified" || node.version == "null") {
+                            break
+                        }
+                        def dependencyNode = dependenciesNode.appendNode('dependency')
+                        dependencyNode.appendNode('groupId', node.group)
+                        dependencyNode.appendNode('artifactId', node.name)
+                        dependencyNode.appendNode('version', node.version)
+                    }
+                }
+            }
+        }
+    }
+    repositories {
+        // The repository to publish to, Sonatype/MavenCentral
+        maven {
+            // This is an arbitrary name, you may also use "mavencentral" or
+            // any other name that's descriptive for you
+            name = "mavencentral"
+
+            def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
+            def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
+            // You only need this if you want to publish snapshots, otherwise just set the URL
+            // to the release repo directly
+            url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
+
+            // The username and password we've fetched earlier
+            credentials {
+                username ossrhUsername
+                password ossrhPassword
+            }
+        }
+    }
+}
+signing {
+    sign publishing.publications
+}
+
+publishReleasePublicationToMavencentralRepository.dependsOn(assemble)

+ 123 - 0
library_platform/shxy/publish.gradle

@@ -0,0 +1,123 @@
+apply plugin: 'maven-publish'
+apply plugin: 'signing'
+
+ext {
+    PUBLISH_GROUP_ID = 'io.github.yyxxgame.sdk'
+    PUBLISH_ARTIFACT_ID = 'yyxx-comm-platform-hnyy'
+    PUBLISH_VERSION = '3.0.100'
+}
+
+
+ext["signing.keyId"] = ''
+ext["signing.password"] = ''
+ext["signing.secretKeyRingFile"] = ''
+ext["ossrhUsername"] = ''
+ext["ossrhPassword"] = ''
+
+
+
+Properties properties = new Properties()
+properties.load(project.rootProject.file('local.properties').newDataInputStream())
+properties.each { name, value ->
+    ext[name] = value
+}
+
+
+task androidSourcesJar(type: Jar) {
+    archiveClassifier.set('source')
+    if (project.plugins.findPlugin('com.android.library')) {
+        from android.sourceSets.main.java.srcDirs
+    } else {
+        form sourceSets.main.java.srcDirs
+    }
+    exclude "**/R.class"
+    exclude "**/BuildConfig.class"
+}
+
+publishing {
+    publications {
+        release(MavenPublication) {
+            // The coordinates of the library, being set from variables that
+            // we'll set up in a moment
+            groupId PUBLISH_GROUP_ID
+            artifactId PUBLISH_ARTIFACT_ID
+            version PUBLISH_VERSION
+
+            // Two artifacts, the `aar` and the sources
+
+
+
+            artifact("$buildDir/outputs/aar/$PUBLISH_ARTIFACT_ID" + "-" + "$PUBLISH_VERSION"+ ".aar")
+            artifact androidSourcesJar
+
+            // Self-explanatory metadata for the most part
+            pom {
+                name = "${PUBLISH_GROUP_ID}${PUBLISH_ARTIFACT_ID}"
+                description = 'game comm sdk of yyxx_comm'
+                // If your project has a dedicated site, use its URL here
+                url = 'https://github.com/yyxxgame'
+                licenses {
+                    license {
+                        // 协议类型,一般默认Apache License2.0的话不用改:
+                        name = 'The Apache License, Version 2.0'
+                        url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+                    }
+                }
+                developers {
+                    developer {
+                        id = 'yyxxgame'
+                        name = 'yyxxgame'
+                        email = 'developcentre@yyxxgame.com'
+                    }
+                }
+                // Version control info, if you're using GitHub, follow the format as seen here
+                scm {
+                    //修改成你的Git地址:
+                    connection = 'scm:git:gogs.yyxxgame.com:3000/Client/YYXXCommSdk.git'
+                    developerConnection = 'scm:git:ssh://gogs.yyxxgame.com:3000/Client/YYXXCommSdk.git'
+                    //分支地址:
+                    url = 'http://gogs.yyxxgame.com:3000/Client/YYXXCommSdk.git'
+                }
+                // A slightly hacky fix so that your POM will include any transitive dependencies
+                // that your library builds upon
+                withXml {
+                    def dependenciesNode = asNode().appendNode('dependencies')
+                    for (def node : project.configurations.implementation.allDependencies) {
+                        if (node.group == "null" || node.name == "unspecified" || node.version == "null") {
+                            break
+                        }
+                        def dependencyNode = dependenciesNode.appendNode('dependency')
+                        dependencyNode.appendNode('groupId', node.group)
+                        dependencyNode.appendNode('artifactId', node.name)
+                        dependencyNode.appendNode('version', node.version)
+                    }
+                }
+            }
+        }
+    }
+    repositories {
+        // The repository to publish to, Sonatype/MavenCentral
+        maven {
+            // This is an arbitrary name, you may also use "mavencentral" or
+            // any other name that's descriptive for you
+            name = "mavencentral"
+
+            def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
+            def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
+            // You only need this if you want to publish snapshots, otherwise just set the URL
+            // to the release repo directly
+            url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
+
+            // The username and password we've fetched earlier
+            credentials {
+                username ossrhUsername
+                password ossrhPassword
+            }
+        }
+    }
+}
+signing {
+    sign publishing.publications
+}
+
+publishReleasePublicationToMavencentralRepository.dependsOn(assemble)

+ 123 - 0
library_platform/xinrui/publish.gradle

@@ -0,0 +1,123 @@
+apply plugin: 'maven-publish'
+apply plugin: 'signing'
+
+ext {
+    PUBLISH_GROUP_ID = 'io.github.yyxxgame.sdk'
+    PUBLISH_ARTIFACT_ID = 'yyxx-comm-platform-shxy'
+    PUBLISH_VERSION = '3.0.100'
+}
+
+
+ext["signing.keyId"] = ''
+ext["signing.password"] = ''
+ext["signing.secretKeyRingFile"] = ''
+ext["ossrhUsername"] = ''
+ext["ossrhPassword"] = ''
+
+
+
+Properties properties = new Properties()
+properties.load(project.rootProject.file('local.properties').newDataInputStream())
+properties.each { name, value ->
+    ext[name] = value
+}
+
+
+task androidSourcesJar(type: Jar) {
+    archiveClassifier.set('source')
+    if (project.plugins.findPlugin('com.android.library')) {
+        from android.sourceSets.main.java.srcDirs
+    } else {
+        form sourceSets.main.java.srcDirs
+    }
+    exclude "**/R.class"
+    exclude "**/BuildConfig.class"
+}
+
+publishing {
+    publications {
+        release(MavenPublication) {
+            // The coordinates of the library, being set from variables that
+            // we'll set up in a moment
+            groupId PUBLISH_GROUP_ID
+            artifactId PUBLISH_ARTIFACT_ID
+            version PUBLISH_VERSION
+
+            // Two artifacts, the `aar` and the sources
+
+
+
+            artifact("$buildDir/outputs/aar/$PUBLISH_ARTIFACT_ID" + "-" + "$PUBLISH_VERSION"+ ".aar")
+            artifact androidSourcesJar
+
+            // Self-explanatory metadata for the most part
+            pom {
+                name = "${PUBLISH_GROUP_ID}${PUBLISH_ARTIFACT_ID}"
+                description = 'game comm sdk of yyxx_comm'
+                // If your project has a dedicated site, use its URL here
+                url = 'https://github.com/yyxxgame'
+                licenses {
+                    license {
+                        // 协议类型,一般默认Apache License2.0的话不用改:
+                        name = 'The Apache License, Version 2.0'
+                        url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+                    }
+                }
+                developers {
+                    developer {
+                        id = 'yyxxgame'
+                        name = 'yyxxgame'
+                        email = 'developcentre@yyxxgame.com'
+                    }
+                }
+                // Version control info, if you're using GitHub, follow the format as seen here
+                scm {
+                    //修改成你的Git地址:
+                    connection = 'scm:git:gogs.yyxxgame.com:3000/Client/YYXXCommSdk.git'
+                    developerConnection = 'scm:git:ssh://gogs.yyxxgame.com:3000/Client/YYXXCommSdk.git'
+                    //分支地址:
+                    url = 'http://gogs.yyxxgame.com:3000/Client/YYXXCommSdk.git'
+                }
+                // A slightly hacky fix so that your POM will include any transitive dependencies
+                // that your library builds upon
+                withXml {
+                    def dependenciesNode = asNode().appendNode('dependencies')
+                    for (def node : project.configurations.implementation.allDependencies) {
+                        if (node.group == "null" || node.name == "unspecified" || node.version == "null") {
+                            break
+                        }
+                        def dependencyNode = dependenciesNode.appendNode('dependency')
+                        dependencyNode.appendNode('groupId', node.group)
+                        dependencyNode.appendNode('artifactId', node.name)
+                        dependencyNode.appendNode('version', node.version)
+                    }
+                }
+            }
+        }
+    }
+    repositories {
+        // The repository to publish to, Sonatype/MavenCentral
+        maven {
+            // This is an arbitrary name, you may also use "mavencentral" or
+            // any other name that's descriptive for you
+            name = "mavencentral"
+
+            def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
+            def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
+            // You only need this if you want to publish snapshots, otherwise just set the URL
+            // to the release repo directly
+            url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
+
+            // The username and password we've fetched earlier
+            credentials {
+                username ossrhUsername
+                password ossrhPassword
+            }
+        }
+    }
+}
+signing {
+    sign publishing.publications
+}
+
+publishReleasePublicationToMavencentralRepository.dependsOn(assemble)