Skip to content

Commit

Permalink
Merge pull request #43 from pushpalroy/release_3.0.1
Browse files Browse the repository at this point in the history
Add dashed line support for extended events
  • Loading branch information
pushpalroy authored Sep 19, 2024
2 parents 58c0020 + a77d144 commit d9b4f46
Show file tree
Hide file tree
Showing 17 changed files with 151 additions and 59 deletions.
29 changes: 20 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ jobs:
build:
strategy:
matrix:
platform: [ android, ios, web, desktop ]
platform: [ android, ios, web-wasm, web-js, desktop ]
include:
- platform: android
os: ubuntu-latest
- platform: web
- platform: web-wasm
os: ubuntu-latest
- platform: web-js
os: ubuntu-latest
- platform: ios
os: macos-latest
Expand Down Expand Up @@ -58,14 +60,23 @@ jobs:
if: matrix.platform == 'ios'
run: ./scripts/build_ios.sh

# Web
- name: Grant execute permission for Web script
if: matrix.platform == 'web'
run: chmod +x ./scripts/build_web.sh
# Web-WASM
- name: Grant execute permission for Web WASM script
if: matrix.platform == 'web-wasm'
run: chmod +x ./scripts/build_web_wasm.sh

- name: Build Web WASM
if: matrix.platform == 'web-wasm'
run: ./scripts/build_web_wasm.sh

# Web-WASM
- name: Grant execute permission for Web JS script
if: matrix.platform == 'web-js'
run: chmod +x ./scripts/build_web_js.sh

- name: Build Web
if: matrix.platform == 'web'
run: ./scripts/build_web.sh
- name: Build Web JS
if: matrix.platform == 'web-js'
run: ./scripts/build_web_js.sh

# MacOS
- name: Grant execute permission for MacOS script
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ In `build.gradle` of shared module, include the following dependency

```gradle
dependencies {
implementation("io.github.pushpalroy:jetlime:3.0.0")
implementation("io.github.pushpalroy:jetlime:3.0.1")
}
```

Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ plugins {
alias(libs.plugins.dokka) apply false
alias(libs.plugins.spotless) apply false
alias(libs.plugins.kotlin.cocoapods) apply false
alias(libs.plugins.compose.compiler.report.generator) apply false
}

// Compose Compiler Metrics
Expand Down
2 changes: 1 addition & 1 deletion docs/scripts/sourceset_dependencies.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ kotlin.native.ignoreDisabledTargets=true
kotlin.mpp.enableCInteropCommonization=true
kotlin.mpp.androidSourceSetLayoutVersion=2
kotlin.mpp.androidGradlePluginCompatibility.nowarn=true
org.jetbrains.compose.experimental.jscanvas.enabled=true
# Before publishing to central the library should be tested in local:
# ./gradlew publishToMavenLocal. This will generate sources for our source sets
# in the .m2 folder locally. Which can be tested by adding mavenLocal() under
Expand Down
10 changes: 6 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
activityCompose = "1.9.2"
agp = "8.5.2"
compose-plugin = "1.6.11"
jetlime = "3.0.0"
jetlime = "3.0.1"
junit = "4.13.2"
junitVersion = "1.2.1"
kotlin = "2.0.20-RC2"
kotlinxCollectionsImmutable = "0.3.7"
truth = "1.3.0"
vanniktech = "0.28.0"
dokka = "1.9.20"
report = "1.4.0"
spotless = "6.25.0"
androidxTest = "1.6.2"

Expand All @@ -24,15 +25,16 @@ truth = { module = "com.google.truth:truth", version.ref = "truth" }
kotlinx-collections-immutable = { module = "org.jetbrains.kotlinx:kotlinx-collections-immutable", version.ref = "kotlinxCollectionsImmutable" }
jetlime = { module = "io.github.pushpalroy:jetlime", version.ref = "jetlime" }
junit = { module = "junit:junit", version.ref = "junit" }
dokka-android = { module = "org.jetbrains.dokka:android-documentation-plugin", version.ref = "dokka"}
dokka-android = { module = "org.jetbrains.dokka:android-documentation-plugin", version.ref = "dokka" }

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
android-library = { id = "com.android.library", version.ref = "agp" }
jetbrains-compose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
compose-compiler-report-generator = { id = "dev.shreyaspatil.compose-compiler-report-generator", version.ref = "report" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlin-cocoapods = { id = "org.jetbrains.kotlin.native.cocoapods", version.ref = "kotlin" }
nexus-vanniktech-publish = { id = "com.vanniktech.maven.publish", version.ref = "vanniktech" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka"}
spotless = { id = "com.diffplug.spotless", version.ref = "spotless"}
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
45 changes: 16 additions & 29 deletions jetlime/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import com.vanniktech.maven.publish.SonatypeHost
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig

plugins {
alias(libs.plugins.android.library)
Expand All @@ -15,54 +14,43 @@ plugins {

kotlin {
cocoapods {
version = "3.0.1"
summary = "JetLime KMP Library"
homepage = "https://github.com/pushpalroy/JetLime"
version = "3.0.0"
ios.deploymentTarget = "14.0"
framework {
baseName = "JetLime"
isStatic = true
}
}

js(IR) {
browser()
binaries.library()
}

@OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class)
wasmJs {
moduleName = "composeApp"
browser {
commonWebpackConfig {
outputFileName = "composeApp.js"
devServer =
(devServer ?: KotlinWebpackConfig.DevServer()).apply {
static =
(static ?: mutableListOf()).apply {
// Serve sources to debug inside browser
add(project.projectDir.path)
}
}
testTask {
enabled = false
}
}
binaries.executable()
binaries.library()
}

androidTarget {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
jvmTarget.set(JvmTarget.JVM_17)
}
}

jvm("desktop")

listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64(),
).forEach { iosTarget ->
iosTarget.binaries.framework {
baseName = "ComposeApp"
isStatic = true
}
}
iosX64()
iosArm64()
iosSimulatorArm64()

sourceSets {
val desktopMain by getting
Expand All @@ -78,7 +66,6 @@ kotlin {
implementation(compose.material3)
implementation(compose.ui)
implementation(compose.components.uiToolingPreview)

api(libs.kotlinx.collections.immutable)
}
desktopMain.dependencies {
Expand Down Expand Up @@ -116,8 +103,8 @@ android {
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
buildFeatures {
compose = true
Expand Down Expand Up @@ -160,7 +147,7 @@ mavenPublishing {
val artifactId = "jetlime"

// Define coordinates for the published artifact
coordinates("io.github.pushpalroy", artifactId, "3.0.0")
coordinates("io.github.pushpalroy", artifactId, "3.0.1")

// Configure POM metadata for the published artifact
pom {
Expand Down
2 changes: 1 addition & 1 deletion jetlime/jetlime.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'jetlime'
spec.version = '3.0.0'
spec.version = '3.0.1'
spec.homepage = 'https://github.com/pushpalroy/JetLime'
spec.source = { :http=> ''}
spec.authors = ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ fun JetLimeExtendedEvent(
start = Offset(x = timelineXOffset, y = yOffset),
end = Offset(x = timelineXOffset, y = this.size.height),
strokeWidth = jetLimeStyle.lineThickness.toPx(),
pathEffect = jetLimeStyle.pathEffect,
)
}

Expand Down
15 changes: 12 additions & 3 deletions sample/composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@ plugins {
alias(libs.plugins.jetbrains.compose)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.kotlin.cocoapods)
alias(libs.plugins.compose.compiler.report.generator)
}

kotlin {
js(IR) {
browser()
binaries.executable()
}

@OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class)
wasmJs {
moduleName = "composeApp"
Expand All @@ -34,7 +40,7 @@ kotlin {
androidTarget {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
jvmTarget.set(JvmTarget.JVM_17)
}
}

Expand Down Expand Up @@ -87,6 +93,9 @@ kotlin {
desktopMain.dependencies {
implementation(compose.desktop.currentOs)
}
jsMain.dependencies {
implementation(compose.html.core)
}
}
}

Expand Down Expand Up @@ -148,8 +157,8 @@ android {
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
buildFeatures {
compose = true
Expand Down
36 changes: 36 additions & 0 deletions sample/composeApp/src/jsMain/kotlin/Main.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* MIT License
*
* Copyright (c) 2024 Pushpal Roy
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.window.CanvasBasedWindow
import org.jetbrains.skiko.wasm.onWasmReady

@OptIn(ExperimentalComposeUiApi::class)
fun main() {
onWasmReady {
CanvasBasedWindow("KotlinBrowser") {
App()
}
}
}
12 changes: 12 additions & 0 deletions sample/composeApp/src/jsMain/resources/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>JetLime Sample</title>
<script type="application/javascript" src="skiko.js"></script>
<script type="application/javascript" src="composeApp.js"></script>
</head>
<body>
<canvas id="ComposeTarget"></canvas>
</body>
</html>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
2 changes: 1 addition & 1 deletion scripts/add_git_tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Script to add annotated tag with version number to the main branch
# This script should be executed with the correct version number after every release to MavenCentral
TAG="3.0.0"
TAG="3.0.1"
COMMENT="Release $TAG"
BRANCH="main"

Expand Down
34 changes: 34 additions & 0 deletions scripts/build_web_js.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

# Exit the script on any error
set -e

# Navigate to the root directory of the project
cd "$(dirname "$0")/.." || exit

# Build Web JS App
echo "Building Web JS App 🌎"
./gradlew :sample:composeApp:jsBrowserDistribution --console=plain --stacktrace

# Check if the build was successful
if [ $? -eq 0 ]; then
echo "Web JS build successful."

# Create the distributions/jetlime-web folder in the root directory
mkdir -p distributions/web-js

# Path to the production executable
WEB_EXECUTABLE_PATH="sample/composeApp/build/dist/js/productionExecutable/"

# Verify and copy the production executable to the distributions folder
if [ -d "$WEB_EXECUTABLE_PATH" ]; then
cp -r "$WEB_EXECUTABLE_PATH" distributions/web-js/
echo "Web JS app copied to distributions/web-js"
else
echo "Web JS build output not found at expected path: $WEB_EXECUTABLE_PATH"
exit 1
fi
else
echo "Web JS build failed."
exit 1
fi
Loading

0 comments on commit d9b4f46

Please sign in to comment.