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

Release v1.0.0 #11

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: set up JDK 11
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
cache: gradle

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ It consist of a leading icon(optional), Text and a trailing icon (optional).
- Built with Compose UI

## Usage

implementation("co.yml:ytag:1.0.0")

**Basic**

Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ plugins {
}

android {
namespace = "co.yml.ytag"
namespace = "co.yml.ytag.app"
defaultConfig {
applicationId = "co.yml.ytag"
applicationId = "co.yml.ytag.app"
versionCode = 1
versionName = "1.0"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.yml.ytag
package co.yml.ytag.app

import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.yml.ytag
package co.yml.ytag.app

import androidx.compose.ui.test.junit4.createAndroidComposeRule
import androidx.lifecycle.Lifecycle
Expand Down Expand Up @@ -38,7 +38,7 @@ class MainActivityTest {
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
Assert.assertTrue(appContext.packageName.contains("co.yml.ytag"))
Assert.assertTrue(appContext.packageName.contains("co.yml.ytag.app"))
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package co.yml.ytag.ui
package co.yml.ytag.app.ui

import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.junit4.createAndroidComposeRule
import androidx.compose.ui.test.onNodeWithTag
import co.yml.ytag.MainActivity
import co.yml.ytag.app.MainActivity
import dagger.hilt.android.testing.HiltAndroidRule
import dagger.hilt.android.testing.HiltAndroidTest
import org.junit.Rule
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
xmlns:tools="http://schemas.android.com/tools"
package="co.yml.ytag.app">

<uses-permission android:name="android.permission.INTERNET" />

<application
android:name="co.yml.ytag.YTag"
android:name=".YTag"
tools:replace="android:allowBackup"
android:allowBackup="false"
android:dataExtractionRules="@xml/data_extraction_rules"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package co.yml.ytag
package co.yml.ytag.app

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import co.yml.ytag.ui.AppScreen
import co.yml.ytag.app.ui.AppScreen
import dagger.hilt.android.AndroidEntryPoint

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.yml.ytag
package co.yml.ytag.app

import android.app.Application
import dagger.hilt.android.HiltAndroidApp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package co.yml.ytag.ui
package co.yml.ytag.app.ui

import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import co.yml.ytag.ui.theme.YTagTheme
import co.yml.ytag.core.ui.theme.YTagTheme

@Composable
fun AppScreen() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.yml.ytag.ui
package co.yml.ytag.app.ui

import androidx.compose.runtime.Composable
import androidx.navigation.compose.NavHost
Expand Down
3 changes: 3 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ buildscript {
mavenCentral()
google()
gradlePluginPortal()
maven {
url = uri("https://plugins.gradle.org/m2/")
}
}
dependencies {
classpath(versionCatalogLibs.android.gradle.plugin)
Expand Down
88 changes: 87 additions & 1 deletion core/ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,99 @@ plugins {
id("co.yml.ytag.library.compose")
id("co.yml.ytag.library")
id("co.yml.ytag.library.jacoco")
id("maven-publish")
id("signing")
id("org.jetbrains.dokka")
}

android {
namespace = "co.yml.ytag.ui"
namespace = "co.yml.ytag.core.ui"
}

dependencies {
testImplementation(project(mapOf("path" to ":core:test")))
androidTestImplementation(project(mapOf("path" to ":core:test")))
}
val dokkaOutputDir = "$buildDir/dokka"

tasks.dokkaHtml {
outputDirectory.set(file(dokkaOutputDir))
}

val deleteDokkaOutputDir by tasks.register<Delete>("deleteDokkaOutputDirectory") {
delete(dokkaOutputDir)
}
val javadocJar = tasks.register<Jar>("javadocJar") {
dependsOn(deleteDokkaOutputDir, tasks.dokkaHtml)
archiveClassifier.set("javadoc")
from(dokkaOutputDir)
}

publishing {
repositories {
maven {
name = "YTag"
setUrl("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2")
credentials {
username = project.findProperty("mavenCentralUsername")?.toString()
?: System.getenv("MAVEN_USERNAME")
password = project.findProperty("mavenCentralPassword")?.toString()
?: System.getenv("MAVEN_PASSWORD")
}
}
}
publications {
register<MavenPublication>("release") {
groupId = "co.yml"
artifactId = "ytag"
version = "1.0.0"
afterEvaluate {
println("Components:${components.names}")
from(components["productionRelease"])
}
artifact(javadocJar)
pom {
name.set("YTag")
description.set("Y Tag is a UI element in Android (some times referred to as chips) which displays a piece of information. It consist of a leading icon(optional), Text and a trailing icon (optional).")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Em dash

url.set("https://github.com/yml-org/YTag-android")
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("sreekuttancj")
name.set("Sreekuttan C J")
url.set("https://github.com/sreekuttancj")
}
developer {
id.set("dkk009")
name.set("Deepak KK")
url.set("https://github.com/dkk009")
}
developer {
id.set("kikoso")
name.set("Enrique López Mañas")
url.set("https://github.com/kikoso")
}
}
scm {
url.set("https://github.com/yml-org/YTag-android")
connection.set("scm:git:git://github.com/yml-org/YTag-android.git")
developerConnection.set("scm:git:ssh://[email protected]:yml-org/YTag-android.git")
}
}
}
}
}
signing {
useInMemoryPgpKeys(
project.findProperty("signing.keyId")?.toString() ?: System.getenv("SIGNINGKEY"),
project.findProperty("signing.InMemoryKey")?.toString() ?: System.getenv("MEMORY_KEY"),
project.findProperty("signing.password")?.toString() ?: System.getenv("SIGNINGPASSWORD")
)
sign(publishing.publications)
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
package co.yml.ytag.ui.ytag
package co.yml.ytag.core.ui.ytag

import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.test.*
import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithTag
import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.printToString
import androidx.compose.ui.unit.dp
import co.yml.ytag.ui.ytag.model.TagViewContainerModifiers
import co.yml.ytag.ui.ytag.model.TagViewData
import co.yml.ytag.ui.ytag.model.TagViewModifiers
import co.yml.ytag.core.ui.ytag.model.TagViewContainerModifiers
import co.yml.ytag.core.ui.ytag.model.TagViewData
import co.yml.ytag.core.ui.ytag.model.TagViewModifiers
import org.junit.Rule
import org.junit.Test

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.yml.ytag.ui.ytag
package co.yml.ytag.core.ui.ytag

import android.R
import androidx.compose.foundation.layout.PaddingValues
Expand All @@ -10,8 +10,11 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.test.*
import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithTag
import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.printToString
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontStyle
Expand All @@ -21,8 +24,8 @@ import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import co.yml.ytag.ui.ytag.model.TagViewData
import co.yml.ytag.ui.ytag.model.TagViewModifiers
import co.yml.ytag.core.ui.ytag.model.TagViewData
import co.yml.ytag.core.ui.ytag.model.TagViewModifiers
import org.junit.Rule
import org.junit.Test

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@file:OptIn(ExperimentalMaterial3Api::class)

package co.yml.ytag.ui.templates
package co.yml.ytag.core.ui.templates

import androidx.compose.foundation.layout.*
import androidx.compose.material3.*
Expand All @@ -12,8 +12,8 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import co.yml.ytag.ui.R
import co.yml.ytag.ui.theme.YTagTheme
import co.yml.ytag.core.ui.R
import co.yml.ytag.core.ui.theme.YTagTheme

/**
* Top app bars display information at the top of a screen.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.yml.ytag.ui.theme
package co.yml.ytag.core.ui.theme

import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.yml.ytag.ui.theme
package co.yml.ytag.core.ui.theme

import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.yml.ytag.ui.theme
package co.yml.ytag.core.ui.theme

import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.staticCompositionLocalOf
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.yml.ytag.ui.theme
package co.yml.ytag.core.ui.theme

import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.runtime.Composable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.yml.ytag.ui.theme
package co.yml.ytag.core.ui.theme

import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.text.TextStyle
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.yml.ytag.ui.ytag
package co.yml.ytag.core.ui.ytag

import android.R
import android.annotation.SuppressLint
Expand Down Expand Up @@ -30,8 +30,8 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.constraintlayout.compose.ConstraintLayout
import androidx.constraintlayout.compose.Dimension
import co.yml.ytag.ui.ytag.model.TagViewData
import co.yml.ytag.ui.ytag.model.TagViewModifiers
import co.yml.ytag.core.ui.ytag.model.TagViewData
import co.yml.ytag.core.ui.ytag.model.TagViewModifiers

/**
* [TagView] Compose method used for creating a custom chip
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.yml.ytag.ui.ytag
package co.yml.ytag.core.ui.ytag

import androidx.compose.animation.animateContentSize
import androidx.compose.animation.core.LinearEasing
Expand All @@ -24,10 +24,10 @@ import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.*
import co.yml.ytag.ui.R
import co.yml.ytag.ui.ytag.model.TagViewContainerModifiers
import co.yml.ytag.ui.ytag.model.TagViewData
import co.yml.ytag.ui.ytag.model.TagViewModifiers
import co.yml.ytag.core.ui.R
import co.yml.ytag.core.ui.ytag.model.TagViewContainerModifiers
import co.yml.ytag.core.ui.ytag.model.TagViewData
import co.yml.ytag.core.ui.ytag.model.TagViewModifiers

/**
* [TagViewContainer] compose method used for hosting multiple chips
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.yml.ytag.ui.ytag.model
package co.yml.ytag.core.ui.ytag.model

import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.shape.CircleShape
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.yml.ytag.ui.ytag.model
package co.yml.ytag.core.ui.ytag.model

import androidx.compose.runtime.Composable

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.yml.ytag.ui.ytag.model
package co.yml.ytag.core.ui.ytag.model

import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.ui.graphics.Color
Expand Down
2 changes: 1 addition & 1 deletion feature/ytag/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ android {
dependencies {
implementation(versionCatalogLibs.hilt.nav.compose)
implementation(versionCatalogLibs.androidx.lifecycle.viewModelCompose)
implementation(project(mapOf("path" to ":core:ui")))
implementation("co.yml:ytag:1.0.0")
implementation(project(mapOf("path" to ":core:test")))
testImplementation(project(mapOf("path" to ":core:test")))

Expand Down
Loading