-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #206 from mikepenz/feature/124
Introduce syntax highlighting support
- Loading branch information
Showing
11 changed files
with
363 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
import com.vanniktech.maven.publish.SonatypeHost | ||
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion | ||
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl | ||
|
||
plugins { | ||
kotlin("multiplatform") | ||
alias(libs.plugins.androidLibrary) | ||
alias(libs.plugins.jetbrainsCompose) | ||
alias(libs.plugins.composeCompiler) | ||
alias(libs.plugins.dokka) | ||
alias(libs.plugins.mavenPublish) | ||
} | ||
|
||
android { | ||
namespace = "com.mikepenz.markdown.code" | ||
compileSdk = libs.versions.compileSdk.get().toInt() | ||
|
||
defaultConfig { | ||
minSdk = libs.versions.minSdk.get().toInt() | ||
targetSdk = libs.versions.targetSdk.get().toInt() | ||
} | ||
|
||
buildTypes { | ||
getByName("release") { | ||
isMinifyEnabled = false | ||
proguardFiles( | ||
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" | ||
) | ||
} | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_11 | ||
targetCompatibility = JavaVersion.VERSION_11 | ||
} | ||
|
||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> { | ||
kotlinOptions.jvmTarget = "11" | ||
|
||
kotlinOptions { | ||
if (project.findProperty("composeCompilerReports") == "true") { | ||
freeCompilerArgs += listOf( | ||
"-P", | ||
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=${project.buildDir.absolutePath}/compose_compiler" | ||
) | ||
} | ||
if (project.findProperty("composeCompilerMetrics") == "true") { | ||
freeCompilerArgs += listOf( | ||
"-P", | ||
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=${project.buildDir.absolutePath}/compose_compiler" | ||
) | ||
} | ||
} | ||
} | ||
} | ||
|
||
kotlin { | ||
applyDefaultHierarchyTemplate() | ||
|
||
targets.all { | ||
compilations.all { | ||
compilerOptions.configure { | ||
languageVersion.set(KotlinVersion.KOTLIN_1_9) | ||
apiVersion.set(KotlinVersion.KOTLIN_1_9) | ||
} | ||
} | ||
} | ||
androidTarget { | ||
publishLibraryVariants("release") | ||
} | ||
jvm { | ||
compilations { | ||
all { | ||
kotlinOptions.jvmTarget = "11" | ||
} | ||
} | ||
|
||
testRuns["test"].executionTask.configure { | ||
useJUnit { | ||
excludeCategories("org.intellij.markdown.ParserPerformanceTest") | ||
} | ||
} | ||
} | ||
@OptIn(ExperimentalWasmDsl::class) | ||
wasmJs { | ||
browser() | ||
} | ||
js(IR) { | ||
nodejs() | ||
} | ||
macosX64() | ||
macosArm64() | ||
iosX64() | ||
iosArm64() | ||
iosSimulatorArm64() | ||
|
||
sourceSets { | ||
val commonMain by getting | ||
val commonTest by getting { | ||
dependencies { | ||
implementation(kotlin("test")) | ||
} | ||
} | ||
val fileBasedTest by creating { | ||
dependsOn(commonTest) | ||
} | ||
val jvmTest by getting { | ||
dependsOn(fileBasedTest) | ||
} | ||
val jsTest by getting { | ||
dependsOn(fileBasedTest) | ||
} | ||
val nativeMain by getting { | ||
dependsOn(commonMain) | ||
} | ||
val nativeTest by getting { | ||
dependsOn(fileBasedTest) | ||
} | ||
val nativeSourceSets = listOf( | ||
"macosX64", | ||
"macosArm64", | ||
"ios", | ||
"iosSimulatorArm64" | ||
).map { "${it}Main" } | ||
for (set in nativeSourceSets) { | ||
getByName(set).dependsOn(nativeMain) | ||
} | ||
val nativeTestSourceSets = listOf( | ||
"macosX64", | ||
"macosArm64" | ||
).map { "${it}Test" } | ||
for (set in nativeTestSourceSets) { | ||
getByName(set).dependsOn(nativeTest) | ||
getByName(set).dependsOn(fileBasedTest) | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
commonMainApi(projects.multiplatformMarkdownRenderer) | ||
commonMainCompileOnly(compose.runtime) | ||
commonMainCompileOnly(compose.ui) | ||
commonMainCompileOnly(compose.foundation) | ||
|
||
commonMainApi(libs.highlights) | ||
} | ||
|
||
tasks.dokkaHtml.configure { | ||
dokkaSourceSets { | ||
configureEach { | ||
noAndroidSdkLink.set(false) | ||
} | ||
} | ||
} | ||
|
||
tasks.create<Jar>("javadocJar") { | ||
dependsOn("dokkaJavadoc") | ||
archiveClassifier.set("javadoc") | ||
from("${layout.buildDirectory}/javadoc") | ||
} | ||
|
||
mavenPublishing { | ||
publishToMavenCentral(SonatypeHost.S01) | ||
signAllPublications() | ||
} | ||
|
||
publishing { | ||
repositories { | ||
maven { | ||
name = "installLocally" | ||
setUrl("${rootProject.layout.buildDirectory}/localMaven") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
POM_NAME=Multiplatform Markdown Renderer - Code | ||
POM_DESCRIPTION=Kotlin Multiplatform Markdown Renderer. (Android, Desktop, ...) powered by Compose Multiplatform | ||
POM_ARTIFACT_ID=multiplatform-markdown-renderer-code |
Oops, something went wrong.