Skip to content

Commit

Permalink
Update copyright, setup maven publish plugin, and fix JS resizing err…
Browse files Browse the repository at this point in the history
…or on Kotlin 1.9.0 and above
  • Loading branch information
shubhamsinghshubham777 committed Sep 1, 2023
1 parent f08561d commit fb50874
Show file tree
Hide file tree
Showing 23 changed files with 485 additions and 72 deletions.
2 changes: 1 addition & 1 deletion adapt/adapt.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |spec|
spec.name = 'adapt'
spec.version = '1.0.0'
spec.homepage = 'empty'
spec.homepage = 'https://github.com/shubhamsinghshubham777/Adapt'
spec.source = { :http=> ''}
spec.authors = ''
spec.license = ''
Expand Down
75 changes: 58 additions & 17 deletions adapt/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
/*
* Copyright 2023 Shubham Singh
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

@file:Suppress("UnstableApiUsage")

import com.vanniktech.maven.publish.SonatypeHost

plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.cocoapods)
alias(libs.plugins.compose)
alias(libs.plugins.maven.publish)
alias(libs.plugins.multiplatform)
}

Expand All @@ -13,7 +32,7 @@ kotlin {
androidTarget {
compilations.all {
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = "17"
}
}
}
Expand All @@ -32,7 +51,7 @@ kotlin {
cocoapods {
version = "1.0.0"
summary = "Adapt UI library"
homepage = "empty"
homepage = "https://github.com/shubhamsinghshubham777/Adapt"
ios.deploymentTarget = "11.0"
framework {
baseName = "adapt"
Expand Down Expand Up @@ -91,8 +110,8 @@ android {
resources.srcDirs("src/commonMain/resources")
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
Expand All @@ -102,18 +121,40 @@ android {
}
}

compose.desktop {
application {
mainClass = "MainKt"

nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageName = "design.adapt.desktopApp"
packageVersion = "1.0.0"
mavenPublishing {
publishToMavenCentral(SonatypeHost.S01)
signAllPublications()
coordinates(
groupId = "io.github.shubhamsinghshubham777",
artifactId = "adapt",
version = "1.0.0-SNAPSHOT"
)
pom {
name.set("Adapt")
description.set(
"Compose Multiplatform UI components for Android, iOS, Desktop, and Web. Unleash " +
"limitless creativity."
)
inceptionYear.set("2023")
url.set("https://github.com/shubhamsinghshubham777/Adapt")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
distribution.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("shubhamsinghshubham777")
name.set("Shubham Singh")
url.set("https://github.com/shubhamsinghshubham777/")
}
}
scm {
url.set("https://github.com/shubhamsinghshubham777/Adapt")
connection.set("scm:git:git://github.com/shubhamsinghshubham777/Adapt.git")
developerConnection.set("scm:git:ssh://[email protected]/shubhamsinghshubham777/Adapt.git")
}
}
}

compose.experimental {
web.application {}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2023 Shubham Singh
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package design.adapt.previews

import androidx.compose.runtime.Composable
Expand Down
16 changes: 16 additions & 0 deletions adapt/src/commonMain/kotlin/design/adapt/AdaptButton.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2023 Shubham Singh
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package design.adapt

import androidx.compose.animation.core.Spring
Expand Down
16 changes: 16 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2023 Shubham Singh
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

plugins {
alias(libs.plugins.android.application).apply(false)
alias(libs.plugins.android.library).apply(false)
Expand Down
16 changes: 16 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
#
# Copyright 2023 Shubham Singh
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

#Gradle
org.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx2048M"
#Kotlin
Expand Down
5 changes: 3 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ agp = "8.1.1"
androidx-activityCompose = "1.7.2"
androidx-appcompat = "1.6.1"
compose = "1.5.0"
# This needs to be at least 1.5.2 (reason: https://github.com/JetBrains/compose-multiplatform/issues/3531#issuecomment-1690831975)
compose-compiler = "1.5.2"
compose-compiler = "1.5.2" # This needs to be at least 1.5.2 (reason: https://github.com/JetBrains/compose-multiplatform/issues/3531#issuecomment-1690831975)
kotlin = "1.9.10"
maven-publish = "0.25.3"

[libraries]
androidx-activityCompose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activityCompose" }
Expand All @@ -17,4 +17,5 @@ android-library = { id = "com.android.library", version.ref = "agp" }
cocoapods = { id = "org.jetbrains.kotlin.native.cocoapods", version.ref = "kotlin" }
compose = { id = "org.jetbrains.compose", version.ref = "compose" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "maven-publish" }
multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
16 changes: 16 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
#
# Copyright 2023 Shubham Singh
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#


distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
Expand Down
22 changes: 19 additions & 3 deletions sample/composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2023 Shubham Singh
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import org.jetbrains.compose.desktop.application.dsl.TargetFormat

plugins {
Expand All @@ -13,7 +29,7 @@ kotlin {
androidTarget {
compilations.all {
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = "17"
}
}
}
Expand Down Expand Up @@ -117,8 +133,8 @@ android {
resources.srcDirs("src/commonMain/resources")
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}

Expand Down
18 changes: 17 additions & 1 deletion sample/composeApp/src/androidMain/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2023 Shubham Singh
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
Expand All @@ -19,4 +35,4 @@
</activity>
</application>

</manifest>
</manifest>
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2023 Shubham Singh
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package design.adapt

import android.app.Application
Expand Down Expand Up @@ -33,4 +49,4 @@ internal actual fun openUrl(url: String?) {
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
}
AndroidApp.INSTANCE.startActivity(intent)
}
}
16 changes: 16 additions & 0 deletions sample/composeApp/src/commonMain/kotlin/design/adapt/App.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2023 Shubham Singh
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package design.adapt

import androidx.compose.foundation.layout.Column
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2023 Shubham Singh
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package design.adapt.theme

import androidx.compose.ui.graphics.Color
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2023 Shubham Singh
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package design.adapt.theme

import androidx.compose.foundation.isSystemInDarkTheme
Expand Down
Loading

0 comments on commit fb50874

Please sign in to comment.