Skip to content

Commit

Permalink
Chore : MavenCentral Setting
Browse files Browse the repository at this point in the history
  • Loading branch information
DongChyeon committed Dec 20, 2024
1 parent 2ee0550 commit f906494
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 20 deletions.
38 changes: 32 additions & 6 deletions app/src/main/java/com/dongchyeon/calendar/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,17 @@ import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Scaffold
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import com.dongchyeon.calendar.ui.Calendar
import com.dongchyeon.calendar.ui.theme.DongChyeonCalendarTheme
import java.time.LocalDate
Expand All @@ -19,15 +26,34 @@ class MainActivity : ComponentActivity() {
enableEdgeToEdge()
setContent {
DongChyeonCalendarTheme {
var selectedDate by remember { mutableStateOf(LocalDate.now()) }
Scaffold(
containerColor = Color.White
) {
Column(modifier = Modifier.padding(it)) {
var selectedDate by remember { mutableStateOf(LocalDate.now()) }

Column {
Calendar(
selectedDate = selectedDate
) {
selectedDate = it
val events = listOf(
CalendarEvent(
date = LocalDate.now().plusDays(1),
imgUrl = "https://picsum.photos/200/300",
imgShape = CircleShape
),
CalendarEvent(
date = LocalDate.now().plusDays(2),
imgUrl = "https://picsum.photos/200/300",
imgShape = RoundedCornerShape(8.dp)
),
)

Calendar(
selectedDate = selectedDate,
events = events,
) {
selectedDate = it
}
}
}

}
}
}
Expand Down
46 changes: 34 additions & 12 deletions calendar/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import com.vanniktech.maven.publish.SonatypeHost

plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.jetbrains.kotlin.android)
`maven-publish`
alias(libs.plugins.maven.publish)
}

android {
Expand Down Expand Up @@ -63,19 +65,39 @@ dependencies {
debugImplementation(libs.androidx.ui.test.manifest)
}

afterEvaluate {
publishing {
publications {
register<MavenPublication>("release") {
groupId = "com.github.DongChyeon"
artifactId = "PhotoCalendar"
version = "1.0.0"
mavenPublishing {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)

signAllPublications()

coordinates("io.github.dongchyeon", "photo-calendar", "1.0.0")

pom {
name.set("PhotoCalendar")
description.set("This project features a customizable Jetpack Compose calendar that allows you to add background images to specific days.")
}
pom {
name.set("PhotoCalendar")
description.set("This project features a customizable Jetpack Compose calendar that allows you to add background images to specific days.") // 라이브러리 설명
url.set("https://github.com/DongChyeon/PhotoCalendar.git")
inceptionYear.set("2024")

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("DongChyeon")
name.set("DongChyeon")
url.set("https://github.com/DongChyeon")
}
}

scm {
url.set("https://github.com/DongChyeon/PhotoCalendar.git")
connection.set("scm:git:git://github.com/DongChyeon/PhotoCalendar.git")
developerConnection.set("scm:git:ssh://[email protected]:DongChyeon/PhotoCalendar.git")
}
}
}
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ composeBom = "2024.04.01"
appcompat = "1.7.0"
material = "1.12.0"
desugar = "2.0.3"
mavenPublish = "0.29.0"

[libraries]
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
Expand Down Expand Up @@ -40,3 +41,4 @@ desugar-jdk-libs = { group = "com.android.tools", name = "desugar_jdk_libs", ver
android-application = { id = "com.android.application", version.ref = "agp" }
jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
android-library = { id = "com.android.library", version.ref = "agp" }
maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "mavenPublish" }
2 changes: 0 additions & 2 deletions jitpack.yml

This file was deleted.

0 comments on commit f906494

Please sign in to comment.