Compare commits

..

16 Commits

16 changed files with 136 additions and 158 deletions

View File

@@ -1,4 +1,3 @@
# noinspection EditorConfigKeyCorrectness
[{*.kt,*.kts}]
ktlint_standard_annotation = disabled
ktlint_standard_filename = disabled
@@ -25,9 +24,10 @@ ktlint_standard_function-naming = disabled
ktlint_standard_chain-method-continuation = disabled
ktlint_standard_class-signature = disabled
ktlint_standard_condition-wrapping = disabled
ktlint_standard_class-signature = disabled
ktlint_standard_blank-line-between-when-conditions = disabled
ktlint_standard_no-trailing-spaces = disabled
ktlint_standard_multiline-loop = disabled
ktlint_standard_when-entry-bracing = disabled
ij_continuation_indent_size = 2
indent_size = 4
indent_style = space

10
.gitignore vendored
View File

@@ -45,9 +45,11 @@
# Kotlin
.kotlin
.idea/kotlinc.xml
# Misc
.idea/misc.xml
.idea/markdown.xml
# CMake
cmake-build-*/
@@ -91,6 +93,8 @@ fabric.properties
.idea/androidTestResultsUserPreferences.xml
# Android projects
.idea/AndroidProjectSystem.xml
.idea/deviceManager.xml
**/local.properties
/captures
.externalNativeBuild
@@ -106,5 +110,11 @@ site
*.bak
.idea/appInsightsSettings.xml
# Discord plugin for IntelliJ
.idea/discord.xml
# Copilot for IntelliJ
.idea/copilot**
# Mac OS
.DS_Store

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AndroidProjectSystem">
<option name="providerId" value="com.android.tools.idea.GradleProjectSystem" />
</component>
</project>

View File

@@ -2,11 +2,6 @@
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="CheckImageSize" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
<option name="processCode" value="true" />
<option name="processLiterals" value="true" />
<option name="processComments" value="true" />
</inspection_tool>
<inspection_tool class="UnstableApiUsage" enabled="false" level="WARNING" enabled_by_default="false" />
</profile>
</component>

6
.idea/kotlinc.xml generated
View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinJpsPluginSettings">
<option name="version" value="2.1.10" />
</component>
</project>

View File

@@ -4,4 +4,8 @@
<ktlintMode>MANUAL</ktlintMode>
<formatOnSave>false</formatOnSave>
</component>
<component name="com.nbadal.ktlint.KtlintProjectSettings">
<ktlintMode>MANUAL</ktlintMode>
<ktlintRulesetVersion>DEFAULT</ktlintRulesetVersion>
</component>
</project>

View File

@@ -1,7 +1,7 @@
# Project Promote
[![GitHub license](https://img.shields.io/github/license/fankes/ProjectPromote?color=blue&style=flat-square)](https://github.com/fankes/ProjectPromote/blob/master/LICENSE)
[![GitHub release](https://img.shields.io/github/v/release/fankes/ProjectPromote?display_name=release&logo=github&color=green&style=flat-square)](https://github.com/fankes/ProjectPromote/releases)
![Maven metadata URL](https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Fraw.githubusercontent.com%2Ffankes%2Fmaven-repository%2Frefs%2Fheads%2Fmain%2Frepository%2Freleases%2Fcom%2Ffankes%2Fprojectpromote%2Fproject-promote%2Fmaven-metadata.xml&logo=apachemaven&logoColor=orange&label=fankes-maven-releases&style=flat-square)
<img src="img-src/icon.png" width = "100" height = "100" alt="LOGO"/>

View File

@@ -1,5 +1,22 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
plugins {
autowire(libs.plugins.android.application) apply false
autowire(libs.plugins.android.library) apply false
autowire(libs.plugins.kotlin.android) apply false
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
}
allprojects {
tasks.withType<KotlinJvmCompile>().configureEach {
compilerOptions {
jvmTarget = JvmTarget.JVM_17
freeCompilerArgs.addAll(
"-opt-in=kotlin.ExperimentalStdlibApi",
"-Xno-param-assertions",
"-Xno-call-assertions",
"-Xno-receiver-assertions"
)
}
}
}

View File

@@ -1,18 +1,18 @@
plugins {
autowire(libs.plugins.android.application)
autowire(libs.plugins.kotlin.android)
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
}
android {
namespace = property.project.app.packageName
compileSdk = property.project.android.compileSdk
namespace = gropify.project.app.packageName
compileSdk = gropify.project.android.compileSdk
defaultConfig {
applicationId = property.project.app.packageName
minSdk = property.project.android.minSdk
targetSdk = property.project.android.targetSdk
versionName = property.project.app.versionName
versionCode = property.project.app.versionCode
applicationId = gropify.project.app.packageName
minSdk = gropify.project.android.minSdk
targetSdk = gropify.project.android.targetSdk
versionName = gropify.project.app.versionName
versionCode = gropify.project.app.versionCode
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
@@ -25,25 +25,17 @@ android {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
freeCompilerArgs = listOf(
"-Xno-param-assertions",
"-Xno-call-assertions",
"-Xno-receiver-assertions"
)
}
buildFeatures { buildConfig = true }
lint { checkReleaseBuilds = false }
}
dependencies {
implementation(project(":projectpromote"))
implementation(androidx.core.core.ktx)
implementation(androidx.appcompat.appcompat)
implementation(com.google.android.material.material)
implementation(androidx.constraintlayout.constraintlayout)
testImplementation(junit.junit)
androidTestImplementation(androidx.test.ext.junit)
androidTestImplementation(androidx.test.espresso.espresso.core)
implementation(libs.core.ktx)
implementation(libs.appcompat)
implementation(libs.material)
implementation(libs.constraintlayout)
testImplementation(libs.junit)
androidTestImplementation(libs.junit.ext)
androidTestImplementation(libs.espresso.core)
}

View File

@@ -3,7 +3,6 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
android.useAndroidX=true
android.nonTransitiveRClass=true
kotlin.code.style=official
kotlin.incremental.useClasspathSnapshot=true
# Project Configuration
project.name=ProjectPromote
project.description=An integrated dependency on my projects promotion for my own use.
@@ -13,12 +12,12 @@ project.licence.url=https://github.com/fankes/ProjectPromote/blob/master/LICENSE
project.developer.id="0"
project.developer.name=fankes
project.developer.email=qzmmcn@163.com
project.android.compileSdk=35
project.android.compileSdk=36
project.android.minSdk=21
project.android.targetSdk=35
project.android.targetSdk=36
project.app.packageName=com.fankes.projectpromote_demo
project.app.versionName=universal
project.app.versionCode=1
project.projectpromote.groupName=com.fankes.projectpromote
project.projectpromote.moduleName=project-promote
project.projectpromote.version=1.0.0
project.projectpromote.version=1.0.1

34
gradle/libs.versions.toml Normal file
View File

@@ -0,0 +1,34 @@
[versions]
agp = "8.13.2"
kotlin = "2.2.21"
maven-publish = "0.35.0"
markwon = "4.6.2"
okhttp = "5.3.2"
lifecycle = "2.10.0"
core-ktx = "1.17.0"
appcompat = "1.7.1"
material = "1.13.0"
constraintlayout = "2.2.1"
junit-ext = "1.3.0"
espresso = "3.7.0"
junit = "4.13.2"
[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
android-library = { id = "com.android.library", version.ref = "agp" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "maven-publish" }
[libraries]
markwon-core = { group = "io.noties.markwon", name = "core", version.ref = "markwon" }
markwon-image = { group = "io.noties.markwon", name = "image", version.ref = "markwon" }
markwon-html = { group = "io.noties.markwon", name = "html", version.ref = "markwon" }
okhttp = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "okhttp" }
lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycle" }
core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "core-ktx" }
appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" }
junit-ext = { group = "androidx.test.ext", name = "junit", version.ref = "junit-ext" }
espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espresso" }
junit = { group = "junit", name = "junit", version.ref = "junit" }

View File

@@ -1,60 +0,0 @@
preferences:
autowire-on-sync-mode: UPDATE_OPTIONAL_DEPENDENCIES
repositories-mode: FAIL_ON_PROJECT_REPOS
repositories:
gradle-plugin-portal:
scope: PLUGINS
google:
maven-central:
jit-pack:
plugins:
com.android.application:
alias: android-application
version: 8.9.0
com.android.library:
alias: android-library
version-ref: android-application
org.jetbrains.kotlin.android:
alias: kotlin-android
version: 2.1.10
com.vanniktech.maven.publish:
alias: maven-publish
version: 0.31.0
libraries:
io.noties.markwon:
core:
version: 4.6.2
image:
version-ref: <this>::core
html:
version-ref: <this>::core
com.squareup.okhttp3:
okhttp:
version: 4.12.0
androidx.lifecycle:
lifecycle-runtime-ktx:
version: 2.8.7
androidx.core:
core-ktx:
version: 1.15.0
androidx.appcompat:
appcompat:
version: 1.7.0
com.google.android.material:
material:
version: 1.12.0
androidx.constraintlayout:
constraintlayout:
version: 2.2.1
androidx.test.ext:
junit:
version: 1.2.1
androidx.test.espresso:
espresso-core:
version: 3.6.1
junit:
junit:
version: 4.13.2

View File

@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@@ -1,15 +1,15 @@
plugins {
autowire(libs.plugins.android.library)
autowire(libs.plugins.kotlin.android)
autowire(libs.plugins.maven.publish)
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.maven.publish)
}
android {
namespace = property.project.projectpromote.groupName
compileSdk = property.project.android.compileSdk
namespace = gropify.project.projectpromote.groupName
compileSdk = gropify.project.android.compileSdk
defaultConfig {
minSdk = property.project.android.minSdk
minSdk = gropify.project.android.minSdk
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}
@@ -23,28 +23,20 @@ android {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
freeCompilerArgs = listOf(
"-Xno-param-assertions",
"-Xno-call-assertions",
"-Xno-receiver-assertions"
)
}
}
dependencies {
implementation(io.noties.markwon.core)
implementation(io.noties.markwon.image)
implementation(io.noties.markwon.html)
implementation(com.squareup.okhttp3.okhttp)
implementation(androidx.lifecycle.lifecycle.runtime.ktx)
implementation(androidx.core.core.ktx)
implementation(androidx.appcompat.appcompat)
implementation(com.google.android.material.material)
testImplementation(junit.junit)
androidTestImplementation(androidx.test.ext.junit)
androidTestImplementation(androidx.test.espresso.espresso.core)
implementation(libs.markwon.core)
implementation(libs.markwon.image)
implementation(libs.markwon.html)
implementation(libs.okhttp)
implementation(libs.lifecycle.runtime.ktx)
implementation(libs.core.ktx)
implementation(libs.appcompat)
implementation(libs.material)
testImplementation(libs.junit)
androidTestImplementation(libs.junit.ext)
androidTestImplementation(libs.espresso.core)
}
publishing {
@@ -64,23 +56,23 @@ publishing {
}
mavenPublishing {
coordinates(property.project.projectpromote.groupName, property.project.projectpromote.moduleName, property.project.projectpromote.version)
coordinates(gropify.project.projectpromote.groupName, gropify.project.projectpromote.moduleName, gropify.project.projectpromote.version)
pom {
name = property.project.name
description = property.project.description
url = property.project.url
name = gropify.project.name
description = gropify.project.description
url = gropify.project.url
licenses {
license {
name = property.project.licence.name
url = property.project.licence.url
distribution = property.project.licence.url
name = gropify.project.licence.name
url = gropify.project.licence.url
distribution = gropify.project.licence.url
}
}
developers {
developer {
id = property.project.developer.id
name = property.project.developer.name
email = property.project.developer.email
id = gropify.project.developer.id
name = gropify.project.developer.name
email = gropify.project.developer.email
}
}
}

View File

@@ -51,13 +51,13 @@ object ProjectPromote {
private const val PROJECT_PROMOTE_MAIN_EN_URL = "https://raw.githubusercontent.com/fankes/fankes/main/project-promote/README.md"
/** 推广链接的主要地址 (CN) */
private const val PROJECT_PROMOTE_MAIN_CN_URL = "https://raw.gitmirror.com/fankes/fankes/main/project-promote/README-zh-CN.md"
private const val PROJECT_PROMOTE_MAIN_CN_URL = "https://raw.githubusercontent.com/fankes/fankes/main/project-promote/README-zh-CN.md"
/** 推广链接的代理地址 (EN) */
private const val PROJECT_PROMOTE_PROXY_EN_URL = "https://raw.githubusercontent.com/fankes/fankes/main/project-promote/README.md"
private const val PROJECT_PROMOTE_PROXY_EN_URL = "https://hub.gitmirror.com/$PROJECT_PROMOTE_MAIN_EN_URL"
/** 推广链接的代理地址 (CN) */
private const val PROJECT_PROMOTE_PROXY_CN_URL = "https://raw.gitmirror.com/fankes/fankes/main/project-promote/README-zh-CN.md"
private const val PROJECT_PROMOTE_PROXY_CN_URL = "https://hub.gitmirror.com/$PROJECT_PROMOTE_MAIN_CN_URL"
/** 记录的 Sp 名称 */
private const val PROJECT_PROMOTE_SP_NAME = "project_promote_readed"

View File

@@ -5,15 +5,22 @@ pluginManagement {
mavenCentral()
}
}
plugins {
id("com.highcapable.sweetdependency") version "1.0.4"
id("com.highcapable.sweetproperty") version "1.0.5"
}
sweetProperty {
global {
sourcesCode { isEnable = false }
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven("https://jitpack.io")
}
rootProject { all { isEnable = false } }
}
plugins {
id("com.highcapable.gropify") version "1.0.1"
}
gropify {
global {
android { isEnabled = false }
}
rootProject { common { isEnabled = false } }
}
rootProject.name = "ProjectPromote"
include(":demo-app")