Skip to content

Commit

Permalink
Fix multiplatform gradle setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Schubert committed Dec 9, 2023
1 parent d4912e7 commit b9f2edf
Show file tree
Hide file tree
Showing 15 changed files with 65 additions and 120 deletions.
26 changes: 7 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

![Icon](https://raw.githubusercontent.com/SimonSchubert/LinuxCommandLibrary/master/art/web_hi_res_144.png)

The app currently has **5055** manual pages, **22+** basic categories and a bunch of general
terminal tips. It works 100% offline, doesn't need an internet connection and has no tracking
software.
The app currently has **5547** manual pages, **22+** basic categories and a bunch of general terminal tips. It works 100% offline, doesn't need an internet connection and has no tracking software.

[![Play Store](https://raw.githubusercontent.com/SimonSchubert/LinuxCommandBibliotheca/master/art/play_store_badge.png)](https://play.google.com/store/apps/details?id=com.inspiredandroid.linuxcommandbibliotheca)
[![F-Droid](https://raw.githubusercontent.com/SimonSchubert/LinuxCommandBibliotheca/master/art/fdroid_badge.png)](https://f-droid.org/en/packages/com.inspiredandroid.linuxcommandbibliotheca/)
Expand Down Expand Up @@ -32,37 +30,27 @@ Execute `gradle :cli:buildJar` to create jar file for Linux, Windows and Mac.

#### Categories

One-liners, System information, System control, Users & Groups, Files & Folders, Input, Printing,
JSON, Network, Search & Find, GIT, SSH, Video & Audio, Package manager, Hacking tools, Terminal
games, Crypto currencies, VIM Texteditor, Emacs Texteditor, Nano Texteditor, Pico Texteditor, Micro
Texteditor
One-liners, System information, System control, Users & Groups, Files & Folders, Input, Printing, JSON, Network, Search & Find, GIT, SSH, Video & Audio, Package manager, Hacking tools, Terminal games, Crypto currencies, VIM Texteditor, Emacs Texteditor, Nano Texteditor, Pico Texteditor, Micro Texteditor

#### Tips

Clear and reset the terminal, List of recent commands, Close a frozen window/application, Tab
Completion, Temporary aliases, Permanent aliases, Chain commands, Command syntax, Cursor navigation,
Redirection, Special characters in commands, View file permissions, Modify file permissions, Set
file permissions via binary references
Clear and reset the terminal, List of recent commands, Close a frozen window/application, Tab Completion, Temporary aliases, Permanent aliases, Chain commands, Command syntax, Cursor navigation, Redirection, Special characters in commands, View file permissions, Modify file permissions, Set file permissions via binary references

### CI/CD

[Github Action](.github/workflows/android.yml) to automatically create a new Github release with APK
and JAR and upload an AAB to the Play Store.
[Github Action](.github/workflows/android.yml) to automatically create a new Github release with APK and JAR and upload an AAB to the Play Store.

### Tests

Android Jetpack Compose screen
tests: [ComposeTests.kt](android/src/androidTest/java/com/inspiredandroid/linuxcommandbibliotheca/ComposeTests.kt)
Android Jetpack Compose screen tests: [ComposeTests.kt](android/src/androidTest/java/com/inspiredandroid/linuxcommandbibliotheca/ComposeTests.kt)

Android Jetpack Compose deeplinking
tests: [ComposeDeeplinkTests.kt](android/src/androidTest/java/com/inspiredandroid/linuxcommandbibliotheca/ComposeDeeplinkTests.kt)
Android Jetpack Compose deeplinking tests: [ComposeDeeplinkTests.kt](android/src/androidTest/java/com/inspiredandroid/linuxcommandbibliotheca/ComposeDeeplinkTests.kt)

Common code unit tests: [CommonTests.kt](common/src/commonTest/kotlin/CommonTests.kt)

### Licensing

The source code is licensed under the Apache 2.0 license and the copyright of the man pages in
the `database.db` file are copyrighted by their respective authors.
The source code is licensed under the Apache 2.0 license and the copyright of the man pages in the `database.db` file are copyrighted by their respective authors.

### Thanks to

Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repositories {

dependencies {
implementation(project(":common"))
implementation("androidx.activity:activity-compose:1.8.0")
implementation("androidx.activity:activity-compose:1.8.1")
implementation("androidx.compose.material:material:1.5.4")
implementation("androidx.navigation:navigation-compose:2.7.5")
implementation("com.google.accompanist:accompanist-appcompat-theme:0.32.0")
Expand Down Expand Up @@ -62,7 +62,7 @@ android {
}

composeOptions {
kotlinCompilerExtensionVersion = "1.5.4"
kotlinCompilerExtensionVersion = "1.5.6"
}

compileOptions {
Expand Down
8 changes: 4 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask

plugins {
id("com.github.ben-manes.versions") version "0.49.0"
id("com.github.ben-manes.versions") version "0.50.0"
}

buildscript {
Expand All @@ -11,14 +11,14 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20")
classpath("com.android.tools.build:gradle:8.1.3")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.21")
classpath("com.android.tools.build:gradle:8.2.0")
classpath("com.squareup.sqldelight:gradle-plugin:1.5.5")
}
}

group = "org.example"
version = "3.2.3"
version = "3.2.4"

allprojects {
repositories {
Expand Down
61 changes: 22 additions & 39 deletions cli/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,56 +1,39 @@
plugins {
kotlin("multiplatform")
application
kotlin("jvm")
}

group = "com.linuxcommandlibrary"
version = parent!!.version

dependencies {
implementation(project(":common"))
implementation("com.squareup.sqldelight:sqlite-driver:1.5.5")
}

kotlin {
jvm {
compilations.all {
kotlinOptions.jvmTarget = "17"
compilerOptions {
sourceSets["main"].apply {
resources.srcDirs("../assets")
}
withJava()
compilations {
val main = getByName("main")
tasks {
register<Jar>("buildJar") {
group = "application"
dependsOn(build)

destinationDirectory.set(file("$projectDir/out"))
archiveFileName.set("linuxcommandlibrary.jar")
}
}

duplicatesStrategy = DuplicatesStrategy.INCLUDE
exclude("META-INF/*.RSA", "META-INF/*.SF","META-INF/*.DSA")
val createJar = tasks.register("createJar", Jar::class) {
archiveBaseName.set("MyApplication")
from(sourceSets["main"].output)

manifest {
attributes["Main-Class"] = "com.linuxcommandlibrary.desktop.ConsoleApplicationKt"
}
from(configurations.getByName("runtimeClasspath").map { if (it.isDirectory) it else zipTree(it) }, main.output.classesDirs)
archiveBaseName.set("${project.name}-fat2")
}
}
}
archiveFileName.set("linuxcommandlibrary.jar")
manifest {
attributes["Main-Class"] = "com.linuxcommandlibrary.cli.ConsoleApplicationKt"
}
from(configurations.getByName("runtimeClasspath").map { if (it.isDirectory) it else zipTree(it) })

sourceSets {
val jvmMain by getting {
dependencies {
implementation(project(":common"))
}
}
val jvmTest by getting
}
duplicatesStrategy = DuplicatesStrategy.INCLUDE
exclude("META-INF/*.RSA", "META-INF/*.SF","META-INF/*.DSA")
}

tasks.processResources {
val contents = "version=${version}"
val file = File("cli/src/jvmMain/resources", "application.properties")
val file = File("cli/src/main/resources", "application.properties")
file.writeText(contents)
}

application {
mainClass.set("ConsoleApplicationKt")
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.linuxcommandlibrary.desktop
package com.linuxcommandlibrary.cli

import com.linuxcommandlibrary.shared.databaseHelper
import com.linuxcommandlibrary.shared.getCurrentVersion
Expand Down
24 changes: 7 additions & 17 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// import org.jetbrains.compose.compose

repositories {
google()
}
Expand All @@ -15,37 +13,29 @@ version = "1.0"

kotlin {
androidTarget()
jvm("desktop") {
compilations.all {
kotlinOptions.jvmTarget = "17"
}
}
jvm()

sourceSets {
val commonMain by getting {
commonMain {
dependencies {

// implementation("androidx.compose.runtime:runtime:1.4.4")
implementation("com.squareup.sqldelight:runtime:1.5.5")
}
}
val commonTest by getting {
commonTest {
dependencies {
implementation(kotlin("test"))
}
}
val androidMain by getting {
androidMain {
dependencies {
api("androidx.appcompat:appcompat:1.6.1")
api("androidx.core:core-ktx:1.12.0")
implementation("com.squareup.sqldelight:android-driver:1.5.5")
}
}
val desktopMain by getting {
jvmMain {
dependencies {
implementation("com.squareup.sqldelight:sqlite-driver:1.5.5")
}
resources.setSrcDirs(listOf("../assets", "../cli/src/jvmMain/resources"))
}
val desktopTest by getting
}
}

Expand Down
30 changes: 13 additions & 17 deletions desktop/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
plugins {
kotlin("multiplatform")
kotlin("jvm")
}

group = "com.linuxcommandlibrary"
version = "1.0"

dependencies {
implementation(project(":common"))
implementation("org.jetbrains.kotlinx:kotlinx-html-jvm:0.9.1")
implementation("org.json:json:20231013")
implementation("com.squareup.sqldelight:sqlite-driver:1.5.5")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
}

kotlin {
jvm {
compilations.all {
kotlinOptions.jvmTarget = "17"
}
withJava()
}
sourceSets {
val jvmMain by getting {
dependencies {
implementation(project(":common"))
implementation("org.jetbrains.kotlinx:kotlinx-html-jvm:0.9.1")
implementation("org.json:json:20231013")
}
compilerOptions {
sourceSets["main"].apply {
resources.srcDirs("../assets")
}
val jvmTest by getting
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -886,13 +886,13 @@ class WebsiteBuilder {
if (showAd) {
div {
style = "text-align: center;"
a("https://coindodo.io/digitalocean") {
a("https://coindodo.io/stge") {
target = ATarget.blank
img {
style = "max-width: calc(100% - 4px);"
src = "/images/af/digitalocean.webp"
src = "/images/af/stge.webp"
attributes["loading"] = "lazy"
width = "480"
width = "800"
}
}
}
Expand Down Expand Up @@ -961,19 +961,6 @@ class WebsiteBuilder {
}
}
}
div {
classes = setOf("project")
a("https://whatch.online") {
target = ATarget.blank
rel = "noopener"
img {
src = "/images/project-whatch.webp"
alt = "whatch.online"
width = "30"
height = "30"
}
}
}
}
}
return this
Expand Down
2 changes: 1 addition & 1 deletion fastlane/metadata/android/en-US/full_description.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
The app currently has <b>5055</b> manual pages, <b>22</b> basic categories and a bunch of general terminal tips. It works 100% offline, doesn't need an internet connection and has no tracking software.
The app currently has <b>5547</b> manual pages, <b>22</b> basic categories and a bunch of general terminal tips. It works 100% offline, doesn't need an internet connection and has no tracking software.

<b>Categories</b>

Expand Down
2 changes: 1 addition & 1 deletion fastlane/metadata/android/en-US/short_description.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5055 manual pages, 22 basic categories and a bunch of general terminal tips.
5547 manual pages, 22 basic categories and a bunch of general terminal tips.
2 changes: 0 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
kotlin.code.style=official
android.useAndroidX=true
kotlin.mpp.enableGranularSourceSetsMetadata=true
kotlin.native.enableDependencyPropagation=false
org.gradle.jvmargs=-Xmx4608m
kotlin.mpp.androidSourceSetLayoutVersion=2
android.defaults.buildfeatures.buildconfig=true
Expand Down
5 changes: 4 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ pluginManagement {
gradlePluginPortal()
mavenCentral()
}
plugins {
kotlin("multiplatform") version "1.9.21"
}
}
rootProject.name = "Linux Command Library"


include(":android", ":desktop", ":common", ":cli")
include(":android", ":common", ":desktop", ":cli")

0 comments on commit b9f2edf

Please sign in to comment.