Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #19

Merged
merged 2 commits into from
May 16, 2024
Merged

Dev #19

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ plugins {
alias(libs.plugins.android.application)
kotlin("android")
alias(libs.plugins.cashapp.redwood)
id("com.github.build.logic")
id("com.jithub.build.logic")
}

android {
namespace = "com.github.app.android"
namespace = "com.jithub.app.android"
compileSdk = Versions.compileSdk
defaultConfig {
applicationId = "com.github.app.android"
applicationId = "com.jithub.app.android"
minSdk = Versions.minSdk
targetSdk = Versions.targetSdk
versionCode = Versions.versionCode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.app.android
package com.jithub.app.android

import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.shape.RoundedCornerShape
Expand Down
12 changes: 6 additions & 6 deletions androidApp/src/main/java/com/github/app/android/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.app.android
package com.jithub.app.android

import android.os.Bundle
import androidx.activity.ComponentActivity
Expand All @@ -13,11 +13,11 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import app.cash.redwood.composeui.RedwoodContent
import app.cash.redwood.layout.composeui.ComposeUiRedwoodLayoutWidgetFactory
import com.github.app.shared.Counter
import com.github.app.shared.MR
import com.github.app.shared.core.StringList
import com.github.app.shared.redwood.composeui.ComposeUiWidgetFactory
import com.github.app.shared.redwood.widget.SchemaWidgetSystem
import com.jithub.app.shared.Counter
import com.jithub.app.shared.MR
import com.jithub.app.shared.core.StringList
import com.jithub.app.shared.redwood.composeui.ComposeUiWidgetFactory
import com.jithub.app.shared.redwood.widget.SchemaWidgetSystem

class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
Expand Down
4 changes: 2 additions & 2 deletions build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repositories {
}
}

group = "com.github.app.buildlogic"
group = "com.jithub.app.buildlogic"

kotlin {
jvmToolchain(17)
Expand All @@ -33,7 +33,7 @@ dependencies {
gradlePlugin {
plugins {
register("build-logic") {
id = "com.github.build.logic"
id = "com.jithub.build.logic"
implementationClass = "BuildLogic"
}
}
Expand Down
43 changes: 39 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,54 @@ plugins {
alias(libs.plugins.kotlin.cocoapods) apply false
// alias(libs.plugins.jetbrains.compose) apply false
alias(libs.plugins.cashapp.redwood) apply false
id("com.github.build.logic") apply false
id("com.jithub.build.logic") apply false
}

subprojects {
tasks.withType<JavaCompile> {
allprojects {
repositories {
google {
mavenContent {
includeGroupAndSubgroups("androidx")
includeGroupAndSubgroups("com.android")
includeGroupAndSubgroups("com.google")
}
}
mavenCentral()
maven("https://jitpack.io")
}

tasks.withType<JavaCompile>().configureEach {
sourceCompatibility = Versions.java.toString()
targetCompatibility = Versions.java.toString()
}

tasks.withType<KotlinCompile> {
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = Versions.java.toString()
}
compilerOptions {
// Treat all Kotlin warnings as errors
allWarningsAsErrors = true
freeCompilerArgs.addAll(
// Enable default methods in interfaces
"-Xjvm-default=all",
// Enable context receivers
"-Xcontext-receivers",
// Enable K2 compiler
"-language-version=2.0",
"-Xsuppress-version-warnings"
)
}
}
}

gradle.taskGraph.whenReady {
tasks.forEach { task ->
/* Encountering the “Unable to make progress running work” Error in Gradle? */
// gradle.startParameter.excludedTaskNames.addAll(listOf(":build-logic:convention:testClasses"))
if (task?.name?.contains(":testClasses", ignoreCase = false) == true) {
task.enabled = false
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion iosApp/Configuration/Config.xcconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
TEAM_ID=
BUNDLE_ID=com.github.app.ios
BUNDLE_ID=com.jithub.app.ios
APP_NAME=kmp-app
2 changes: 1 addition & 1 deletion iosApp/iosApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 1130;
LastUpgradeCheck = 1530;
ORGANIZATIONNAME = github.com;
ORGANIZATIONNAME = jithub.com;
TargetAttributes = {
7555FF7A242A565900829871 = {
CreatedOnToolsVersion = 11.3.1;
Expand Down
2 changes: 1 addition & 1 deletion iosApp/iosApp/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// iosApp
//
// Created by syxc on 2024/5/9.
// Copyright © 2024 github.com. All rights reserved.
// Copyright © 2024 jithub.com. All rights reserved.
//

import shared
Expand Down
2 changes: 1 addition & 1 deletion iosApp/iosApp/CounterViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// iosApp
//
// Created by syxc on 2024/5/9.
// Copyright © 2024 github.com. All rights reserved.
// Copyright © 2024 jithub.com. All rights reserved.
//

import Foundation
Expand Down
2 changes: 1 addition & 1 deletion iosApp/iosApp/HomeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// iosApp
//
// Created by syxc on 2024/5/9.
// Copyright © 2024 github.com. All rights reserved.
// Copyright © 2024 jithub.com. All rights reserved.
//

import SwiftUI
Expand Down
2 changes: 1 addition & 1 deletion iosApp/iosApp/Launch Screen.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Copyright © 2024 github.com. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="obG-Y5-kRd">
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Copyright © 2024 jithub.com. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="obG-Y5-kRd">
<rect key="frame" x="0.0" y="817.66666666666663" width="393" height="14.333333333333371"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
Expand Down
2 changes: 1 addition & 1 deletion iosApp/iosApp/MokoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// iosApp
//
// Created by syxc on 2024/5/9.
// Copyright © 2024 github.com. All rights reserved.
// Copyright © 2024 jithub.com. All rights reserved.
//

import shared
Expand Down
2 changes: 1 addition & 1 deletion iosApp/iosApp/MokoViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// iosApp
//
// Created by syxc on 2024/5/9.
// Copyright © 2024 github.com. All rights reserved.
// Copyright © 2024 jithub.com. All rights reserved.
//

import SwiftUI
Expand Down
2 changes: 1 addition & 1 deletion redwood/schema/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ dependencies {
}

redwoodSchema {
type.set("com.github.app.shared.redwood.Schema")
type.set("com.jithub.app.shared.redwood.Schema")
}
2 changes: 1 addition & 1 deletion redwood/schema/compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ kotlin {

redwoodSchema {
source.set(projects.redwood.schema)
type.set("com.github.app.shared.redwood.Schema")
type.set("com.jithub.app.shared.redwood.Schema")
}

/* task 'testClasses' not found in project */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.app.shared
package com.jithub.app.shared

enum class ButtonType {
Primary,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.app.shared
package com.jithub.app.shared

enum class InputType {
Text,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.app.shared
package com.jithub.app.shared

enum class TextType {
Header,
Expand Down
6 changes: 3 additions & 3 deletions redwood/schema/redwood-api.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<schema type="com.github.app.shared.redwood.Schema" version="1">
<widget tag="2" type="com.github.app.shared.redwood.Text">
<schema type="com.jithub.app.shared.redwood.Schema" version="1">
<widget tag="2" type="com.jithub.app.shared.redwood.Text">
<property name="text" tag="1" type="kotlin.String?" />
</widget>
<widget tag="3" type="com.github.app.shared.redwood.Button">
<widget tag="3" type="com.jithub.app.shared.redwood.Button">
<property name="text" tag="1" type="kotlin.String?" />
<property name="enabled" tag="2" type="kotlin.Boolean" />
<event name="onClick" nullable="true" tag="3" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@file:Suppress("ktlint:standard:filename")

package com.github.app.shared.redwood
package com.jithub.app.shared.redwood

import app.cash.redwood.layout.RedwoodLayout
import app.cash.redwood.schema.Default
Expand Down
2 changes: 1 addition & 1 deletion redwood/schema/testing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ kotlin {

redwoodSchema {
source.set(projects.redwood.schema)
type.set("com.github.app.shared.redwood.Schema")
type.set("com.jithub.app.shared.redwood.Schema")
}

/* task 'testClasses' not found in project */
Expand Down
2 changes: 1 addition & 1 deletion redwood/schema/widget/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ kotlin {

redwoodSchema {
source.set(projects.redwood.schema)
type.set("com.github.app.shared.redwood.Schema")
type.set("com.jithub.app.shared.redwood.Schema")
}

/* task 'testClasses' not found in project */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.app.shared.redwood.composeui
package com.jithub.app.shared.redwood.composeui

import androidx.compose.ui.graphics.Color

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.github.app.shared.redwood.composeui
package com.jithub.app.shared.redwood.composeui

import app.cash.redwood.Modifier as RedwoodModifier
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material3.Button
import androidx.compose.material3.Text
Expand All @@ -9,7 +8,8 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import com.github.app.shared.redwood.widget.Button
import app.cash.redwood.Modifier as RedwoodModifier
import com.jithub.app.shared.redwood.widget.Button

internal class ComposeUiButton : Button<@Composable () -> Unit> {
private var text by mutableStateOf("")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.github.app.shared.redwood.composeui
package com.jithub.app.shared.redwood.composeui

import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import app.cash.redwood.Modifier
import com.github.app.shared.redwood.widget.Text
import com.jithub.app.shared.redwood.widget.Text

internal class ComposeUiText : Text<@Composable () -> Unit> {
private var text by mutableStateOf("")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.github.app.shared.redwood.composeui
package com.jithub.app.shared.redwood.composeui

import androidx.compose.runtime.Composable
import com.github.app.shared.redwood.widget.Button
import com.github.app.shared.redwood.widget.SchemaWidgetFactory
import com.github.app.shared.redwood.widget.Text
import com.jithub.app.shared.redwood.widget.Button
import com.jithub.app.shared.redwood.widget.SchemaWidgetFactory
import com.jithub.app.shared.redwood.widget.Text

object ComposeUiWidgetFactory : SchemaWidgetFactory<@Composable () -> Unit> {
override fun Text(): Text<@Composable () -> Unit> = ComposeUiText()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.app.shared.redwood.composeui
package com.jithub.app.shared.redwood.composeui

import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.MaterialTheme
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.app.shared.redwood.composeui
package com.jithub.app.shared.redwood.composeui

import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Shapes
Expand Down
3 changes: 0 additions & 3 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ include(":redwood:schema:widget")
include(":redwood:schema:testing")
include(":redwood:shared-composeui")

/* Encountering the “Unable to make progress running work” Error in Gradle? */
gradle.startParameter.excludedTaskNames.addAll(listOf(":build-logic:convention:testClasses"))

check(JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) {
"This project needs to be run with Java 17 or higher (found: ${JavaVersion.current()})."
}
4 changes: 2 additions & 2 deletions shared-compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ kotlin {
}

android {
namespace = "com.github.app.share"
namespace = "com.jithub.app.share"
compileSdk = Versions.compileSdk

sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
sourceSets["main"].res.srcDirs("src/androidMain/res")
sourceSets["main"].resources.srcDirs("src/commonMain/resources")

defaultConfig {
// applicationId = "com.github.app.share"
// applicationId = "com.jithub.app.share"
minSdk = Versions.minSdk
}

Expand Down
6 changes: 3 additions & 3 deletions shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ kotlin {
podfile = project.file("../iosApp/Podfile")
framework {
baseName = "shared"
binaryOptions["bundleId"] = "com.github.app.shared"
binaryOptions["bundleId"] = "com.jithub.app.shared"
isStatic = true
export(moko.resources)
export("dev.icerock.moko:graphics:0.9.0")
Expand Down Expand Up @@ -74,11 +74,11 @@ kotlin {
}

multiplatformResources {
resourcesPackage.set("com.github.app.shared")
resourcesPackage.set("com.jithub.app.shared")
}

android {
namespace = "com.github.app.shared"
namespace = "com.jithub.app.shared"
compileSdk = Versions.compileSdk

defaultConfig {
Expand Down
2 changes: 1 addition & 1 deletion shared/src/androidMain/kotlin/Platform.android.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import android.os.Build
import com.github.app.shared.MR
import com.jithub.app.shared.MR
import dev.icerock.moko.resources.StringResource

class AndroidPlatform : Platform {
Expand Down
Loading
Loading