Commit 4526b572 authored by p x's avatar p x
Browse files

集成成功

parent aac07701
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
// alias(libs.plugins.kotlin.android)
// alias(libs.plugins.jetbrains.kotlin.android)
// id("kotlin-kapt")
}
......@@ -31,9 +31,9 @@ android {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = "11"
}
// kotlinOptions {
// jvmTarget = "11"
// }
buildFeatures {
dataBinding = true
viewBinding = true
......@@ -90,11 +90,11 @@ dependencies {
}
//configurations.all {
// resolutionStrategy.dependencySubstitution {
// if (file("${rootProject.projectDir}/fusedLibrary/build/repo").exists()) {
// substitute(project(":fusedLibrary"))
// .using(module("my-company:my-fused-library:1.0"))
// }
// }
//}
configurations.all {
resolutionStrategy.dependencySubstitution {
if (file("${rootProject.projectDir}/fusedLibrary/build/repo").exists()) {
substitute(project(":mapapi"))
.using(module("my-company:my-fused-library:1.0"))
}
}
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
// dependencies {
// classpath("com.google.android.libraries.mapsplatform.secrets-gradle-plugin:fusedlibrary:9.0.0")
// }
}
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.android) apply false
// alias(libs.plugins.jetbrains.kotlin.android) apply false
alias(libs.plugins.android.library) apply false
// alias(libs.plugins.android.fusedlibrary) apply false
// alias(libs.plugins.legacy.kapt) apply false
alias(libs.plugins.android.fusedlibrary) apply false
}
......@@ -31,8 +31,8 @@ signing.password=24875D73
signing.secretKeyRingFile=/secring.gpg
#???? Kotlin
#????? AGP 9.0 ???????????? Kotlin ??? AGP 9.0 ????? AGP ?????????? Kotlin????????????????????????????? gradle.properties ?????
#android.builtInKotlin=false
#android.newDsl=false
android.builtInKotlin=true
android.newDsl=false
# Required for builds with at least one module applying
# the experimental "com.android.fused-library" plugin.
#android.experimental.fusedLibrarySupport=true
......
[versions]
agp = "8.9.1"
agp = "9.0.0"
#kotlin = "2.1.20"
kotlin = "2.0.21"
coreKtx = "1.16.0"
......@@ -11,7 +11,7 @@ material = "1.12.0"
activity = "1.10.1"
constraintlayout = "2.2.1"
kotlin_parcelize = "2.0.21"
fused_version="8.13.2"
fused_version="9.0"
[libraries]
......@@ -28,10 +28,11 @@ androidx-constraintlayout = { group = "androidx.constraintlayout", name = "const
[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
android-fusedlibrary = { id = "com.android.fused-library", version.ref = "agp" }
android-library = { id = "com.android.library", version.ref = "agp" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
#jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
android-library = { id = "com.android.library", version.ref = "agp" }
android-fusedlibrary = { id = "com.android.fused-library", version.ref = "agp"}
kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "agp" }
# Add the following plugin definition
legacy-kapt = { id = "com.android.legacy-kapt", version.ref = "agp" }
......@@ -2,6 +2,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
#distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
distributionUrl=https\://mirrors.aliyun.com/macports/distfiles/gradle/gradle-8.11.1-bin.zip
#distributionSha256Sum=a17ddd85a26b6a7f5ddb71ff8b05fc5104c0202c6e64782429790c933686c806
distributionUrl=https\://mirrors.aliyun.com/macports/distfiles/gradle/gradle-9.1.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
import org.jetbrains.dokka.gradle.engine.parameters.VisibilityModifier
plugins {
alias(libs.plugins.android.library)
// alias(libs.plugins.android.fusedlibrary)
alias(libs.plugins.kotlin.android)
id("kotlin-kapt")
id("kotlin-parcelize")
// Generates HTML documentation
id("org.jetbrains.dokka") version "2.1.0"
// Generates Javadoc documentation
id("org.jetbrains.dokka-javadoc") version "2.1.0"
alias(libs.plugins.android.fusedlibrary)
`maven-publish`
}
androidFusedLibrary {
namespace = "com.example.fusedlibrary"
minSdk {
version = release(21)
}
// If aarMetadata is not explicitly specified,
// aar metadata will be generated based on dependencies.
// aarMetadata {
// minCompileSdk = 21
// minCompileSdkExtension = 1
// }
}
publishing {
publications {
register<MavenPublication>("release") {
groupId = "my-company"
artifactId = "my-fused-library"
version = "1.0"
from(components["fusedLibraryComponent"])
}
}
repositories {
maven {
name = "myrepo"
url = uri(layout.buildDirectory.dir("repo"))
}
}
}
android {
/*android {
namespace = "com.cusc.map"
compileSdk = 35
......@@ -40,280 +62,17 @@ android {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = "11"
}
buildFeatures {
// dataBinding = true
viewBinding = true
}
android.libraryVariants.all {
outputs.all {
if (this is com.android.build.gradle.internal.api.LibraryVariantOutputImpl) {
// val config = project.android.defaultConfig
// val versionName = config.versionName
// val formatter = DateTimeFormatter.ofPattern("yyyy_MM_dd_HHmm")
// val createTime = LocalDateTime.now().format(formatter)
outputFileName = "cusc_map_${version}.aar"
}
}
}
}
}*/
dependencies {
dependencies {
// api(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar", "*.aar"))))
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.material)
implementation(libs.androidx.constraintlayout)
implementation(libs.androidx.activity)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
// implementation("org.jetbrains.dokka:android-documentation-plugin:2.1.0")
// dokkaJavadocPlugin("org.jetbrains.dokka:kotlin-as-java-plugin:2.1.0")
dokkaJavadocPlugin("org.jetbrains.dokka:kotlin-as-java-plugin")
// dokkaHtmlPlugin("org.jetbrains.dokka:kotlin-as-java-plugin")
api(project(":maplibs"))
//公共工具类库
implementation(project(":mycomutils"))
include(project(":maplibs"))
include(project(":mypubdep"))
// Webview交互
api("com.github.lzyzsd:jsbridge:1.0.4")
//四维高精地图依赖
// implementation("daohang.tingche.unityLibrary:adas:1.0")
//高德
// implementation("com.amap.api:navi-3dmap:latest.integration")
// implementation("com.amap.api:search:latest.integration")
//网络
implementation("com.squareup.okhttp3:okhttp:3.12.0")
implementation("com.google.code.gson:gson:2.8.6")
// 权限请求框架
implementation("com.guolindev.permissionx:permissionx:1.8.1")
// ViewModel
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2")
//fragment-ktx
implementation("androidx.fragment:fragment-ktx:1.8.0")
// compileOnly("org.jsoup:jsoup:1.17.2") // 最新稳定版
}
dokka {
/* pluginsConfiguration.html {
// customAssets.from("logo.png")
customStyleSheets.from("dokka/dokka-custom.css")
// footerMessage.set("(c) Your Company")
// separateInheritedMembers.set(false)
// templatesDir.set(file("dokka/templates"))
// mergeImplicitExpectActualDeclarations.set(false)
}*/
dokkaPublications.html {
offlineMode.set(true)
}
dokkaPublications.javadoc {
moduleName.set("CMapSdk")
// moduleVersion.set(project.version.toString())
description = "Android 地图SDK"
// Standard output directory for HTML documentation
// outputDirectory.set(layout.buildDirectory.dir("dokka/html"))
failOnWarning.set(false)
// 禁用包列表的树形展示
suppressInheritedMembers.set(true)
suppressObviousFunctions.set(true)
offlineMode.set(true)
dokkaSourceSets {
configureEach {
includes.from("package-info.md")
skipEmptyPackages.set(false)
skipDeprecated.set(false)
suppressGeneratedFiles.set(true)
jdkVersion.set(17)
documentedVisibilities.set(setOf(VisibilityModifier.Public)) // OR documentedVisibilities(VisibilityModifier.Public)
perPackageOption {
matchingRegex.set(".*map2d\\.amap|.*map2d\\.mine")
suppress.set(true)//suppress = true:完全禁用匹配包的文档生成
}
perPackageOption {
matchingRegex.set(".*core.*|.*fragments.*|.*scenario\\.mine.*|overlay")
suppress.set(true)//suppress = true:完全禁用匹配包的文档生成
}
perPackageOption {
matchingRegex.set(".*ui\\.dialog.*|.*ui\\.widget.*|.*utils.*|.*vms.*")
suppress.set(true)//suppress = true:完全禁用匹配包的文档生成
// skipDeprecated.set(false)
// reportUndocumented.set(false)
// documentedVisibilities.set(
// setOf(
// VisibilityModifier.Public,
// VisibilityModifier.Private,
// VisibilityModifier.Protected,
// VisibilityModifier.Internal,
// VisibilityModifier.Package
// ))
}
}
}
}
}
// 新增删除Tree和Package标签的Gradle任务
tasks.register("removeUnwantedTags") {
group = "documentation"
description = "删除HTML文档中所有的Tree和Package标签及相关链接"
// 定义HTML文件所在目录(根据实际dokka输出目录调整)
val docOutputDir = layout.buildDirectory.dir("dokka/javadoc")
inputs.dir(docOutputDir)
outputs.dir(docOutputDir)
doLast {
val docDir = docOutputDir.get().asFile
if (!docDir.exists()) {
println("文档目录不存在: ${docDir.absolutePath}")
return@doLast
}
// 遍历所有HTML文件
docDir.walk().filter { it.isFile && it.extension == "html" }.forEach { htmlFile ->
println("处理文件: ${htmlFile.absolutePath}")
// 读取文件内容
var content = htmlFile.readText(Charsets.UTF_8)
// 1. 删除导航栏中的Tree标签(匹配标准格式+变体)
val treeNavPattern = Regex("""<li><a href="overview-tree\.html">Tree</a></li>""")
val treeLinkPattern = Regex("""<li><a href="package-tree\.html">Tree</a></li>""")
// val treeLinkPattern = Regex("""<li><a href="overview-tree\.html">Tree</a></li>""")
content = content.replace(treeNavPattern, "")
content = content.replace(treeLinkPattern, "")
// 2. 删除导航栏中的Package标签(核心新增逻辑)
// 匹配标准Package标签行(含前后空白)
val packageNavPattern = Regex("""\s*<li>Package</li>\s*""")
// 匹配带额外属性的Package标签变体(如class/style等)
content = content.replace(packageNavPattern, "")
// 3.1 导航栏中的Deprecated入口标签(标准格式+带属性变体)
val deprecatedNavPattern =
Regex("""<li><a href=".*?deprecated\.html">Deprecated</a></li>""")
content = content.replace(deprecatedNavPattern, "")
// 删除Class标签
val clsNavPattern = Regex("""<li>Class</li>""")
content = content.replace(clsNavPattern, "")
//删除Help标签
val helpNavPattern = Regex("""<li>Help</li>""")
content = content.replace(helpNavPattern, "")
// ========== 4. 删除冗余文件 ==========
/* val redundantFiles = listOf(
docDir.resolve("overview-tree.html"), // Tree相关文件
docDir.resolve("deprecated.html") // Deprecated相关文件
)
redundantFiles.forEach { file ->
if (file.exists()) {
file.delete()
println("🗑️ 删除冗余文件: ${file.absolutePath}")
}
}*/
// 覆盖原文件
htmlFile.writeText(content, Charsets.UTF_8)
println("已移除标签: ${htmlFile.absolutePath}")
}
}
}
// 可选:让dokka任务执行完成后自动执行删除Tree标签任务
tasks.named("dokkaGenerateJavadoc") {
finalizedBy("removeUnwantedTags")
include("com.github.lzyzsd:jsbridge:1.0.4")
}
// 在 build.gradle.kts 中添加
tasks.register("generateOverviewTree") {
group = "documentation"
description = "Generate overview-tree.html for Javadoc"
doLast {
val outputDir = file("${layout.buildDirectory.get()}/dokka/javadoc")
outputDir.mkdirs()
val treeFile = outputDir.resolve("overview-tree.html")
// 读取现有的包信息
val packages = mutableListOf<Pair<String, String>>().apply {
add("com.cusc.map.location" to "定位包,提供定位功能")
add("com.cusc.map.map2d" to "二维地图包,提供栅格地图显示、覆盖物绘制等功能")
add("com.cusc.map.map2d.cdata" to "二维地图包数据业务实体")
add("com.cusc.map.map2d.inters" to "二维地图接口包")
add("com.cusc.map.map3d" to "三维地图包,基于3dtitle的地图绘制")
add("com.cusc.map.parkroad" to "车道局部地图包")
add("com.cusc.map.scenario" to "业务相关包,提供车辆、感知物、预警管理")
add("com.cusc.map.scenario.bean" to "业务数据实体类")
add("com.cusc.map.ui" to "界面相关包,包含地图底图")
}
// 构建包层次结构
val packageTree = mutableMapOf<String, MutableList<Pair<String, String>>>()
packages.forEach { (pkg, desc) ->
val parts = pkg.split(".")
if (parts.size > 3) { // 假设 com.cusc.map 是根包
val parent = parts.take(3).joinToString(".")
val child = pkg
packageTree.getOrPut(parent) { mutableListOf() }.add(child to desc)
}
}
// 生成HTML内容
val htmlContent = """
<!DOCTYPE HTML>
<html lang="zh">
<head>
<title>mapapi 1.0.0</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="dokka-javadoc-stylesheet.css" title="Style">
<style>
.tree ul { padding-left: 20px; list-style-type: none; }
.tree li { margin: 5px 0; }
.package-link { color: #0066CC; }
</style>
</head>
<body>
<div class="contentContainer">
<div class="block">
<ul class="tree">
<li>
<strong>com.cusc.map</strong>
<ul>
${
packages.joinToString("") { (pkg, desc) ->
val pkgPath = pkg.replace(".", "/")
"""
<li>
<a href="$pkgPath/package-summary.html" class="package-link">$pkg</a>
<span style="color: #666; font-size: 12px;">$desc</span>
</li>
"""
}
}
</ul>
</li>
</ul>
</div>
</div>
</body>
</html>
""".trimIndent()
treeFile.writeText(htmlContent)
println("Generated overview-tree.html at: ${treeFile.absolutePath}")
}
}
package com.cusc.map.map2d.mine
import android.os.Parcel
import android.os.Parcelable
import com.cusc.map.map2d.cdata.WayPoi
import com.cusc.map.map2d.cdata.LatLng
import kotlinx.parcelize.Parcelize
import java.io.Serializable
//import kotlinx.parcelize.Parcelize
/**
* 导航参数跳转
*/
@Parcelize
//@Parcelize
data class MineNaiParams(
val starPoint: LatLng,
val startName: String,
val endPoint: LatLng,
val endName: String,
val ways: List<WayPoi>
) : Parcelable
\ No newline at end of file
) : Serializable {
}
\ No newline at end of file
import org.gradle.internal.declarativedsl.parsing.main
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
// id("maven-publish")
}
android {
// enableKotlin = true
namespace = "com.mone.navi"
compileSdk = 35
......@@ -30,14 +28,10 @@ android {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = "11"
}
}
dependencies {
api(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar", "*.aar"))))
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar", "*.aar"))))
}
/build
\ No newline at end of file
plugins {
alias(libs.plugins.android.library)
}
android {
namespace = "com.sd.mypubdep"
compileSdk {
version = release(35)
}
defaultConfig {
minSdk = 29
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}
buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}
dependencies {
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.material)
implementation(libs.androidx.constraintlayout)
implementation(libs.androidx.activity)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
//公共工具类库
implementation(project(":mycomutils"))
//网络
implementation("com.squareup.okhttp3:okhttp:3.12.0")
implementation("com.google.code.gson:gson:2.8.6")
// 权限请求框架
implementation("com.guolindev.permissionx:permissionx:1.8.1")
// ViewModel
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2")
//fragment-ktx
implementation("androidx.fragment:fragment-ktx:1.8.0")
}
\ No newline at end of file
# 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
\ No newline at end of file
package com.sd.mypubdep
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.sd.mypubdep.test", appContext.packageName)
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>
\ No newline at end of file
package com.sd.mypubdep
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}
\ No newline at end of file
pluginManagement {
repositories {
// maven {
// setUrl("https://maven.aliyun.com/repository/central")
// setUrl("https://maven.aliyun.com/repository/jcenter")
// setUrl("https://maven.aliyun.com/repository/google")
// setUrl("https://maven.aliyun.com/repository/gradle-plugin")
// setUrl("https://maven.aliyun.com/repository/public")
// }
google {
content {
includeGroupByRegex("com\\.android.*")
......@@ -14,25 +7,36 @@ pluginManagement {
includeGroupByRegex("androidx.*")
}
}
mavenCentral()
gradlePluginPortal()
mavenCentral()
maven(url = uri("${rootProject.projectDir}/mapapi/build/repo"))
// maven {
// setUrl("https://maven.aliyun.com/repository/central")
// setUrl("https://maven.aliyun.com/repository/jcenter")
// setUrl("https://maven.aliyun.com/repository/google")
// setUrl("https://maven.aliyun.com/repository/gradle-plugin")
// setUrl("https://maven.aliyun.com/repository/public")
// }
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven {
// setUrl("https://maven.aliyun.com/repository/central")
// setUrl("https://maven.aliyun.com/repository/jcenter")
// setUrl("https://maven.aliyun.com/repository/google")
// setUrl("https://maven.aliyun.com/repository/gradle-plugin")
// setUrl("https://maven.aliyun.com/repository/public")
setUrl("https://maven.aliyun.com/repository/central")
setUrl("https://maven.aliyun.com/repository/jcenter")
setUrl("https://maven.aliyun.com/repository/google")
setUrl("https://maven.aliyun.com/repository/gradle-plugin")
setUrl("https://maven.aliyun.com/repository/public")
setUrl("https://jitpack.io")
}
maven(url = uri("${rootProject.projectDir}/mapapi/build/repo"))
maven { setUrl("https://repo.osgeo.org/repository/release/")}
google()
mavenCentral()
mavenLocal()
// google()
// mavenCentral()
// mavenLocal()
}
}
......@@ -42,3 +46,4 @@ include(":mapapi")
include(":maplibs")//存放三方地图aar包
include(":sixteen_parse")//16进制解析库
include(":mycomutils") //常用工具类
include(":mypubdep") //公共应用
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
// alias(libs.plugins.kotlin.android)
}
android {
......@@ -29,9 +29,6 @@ android {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = "11"
}
}
dependencies {
......
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