Skip to content

Commit

Permalink
JitPack Integration (#2)
Browse files Browse the repository at this point in the history
- Added JitPack integration to distribute build aar, javadoc, and sources: https://jitpack.io/#digidemic/kyaml
  - Kyaml can then be installed within your project's build.gradle.
  • Loading branch information
Digidemic committed May 24, 2024
1 parent ff1b8f5 commit e7bf6e5
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 28 deletions.
41 changes: 25 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ baz: true

<br>

#### Check out the [example app for Kyaml](/example-kyaml/)!
### Check out the [example app for Kyaml](/example-kyaml/)!

<br>

Expand Down Expand Up @@ -233,24 +233,33 @@ Usage is simply calling [Kyaml()](#usage--examples) passing up to four arguments

## Installation

### Install with AAR and gradle (Local)
1) Download the latest [kyaml.aar](kyaml.aar).
2) Move `kyaml.aar` to your project's `libs` directory (Example: `YourProject/app/libs/`).
3) In your `build.gradle`, add <b>only one</b> of the following to your `dependencies { }`:
### Install with JitPack
[![](https://jitpack.io/v/Digidemic/kyaml.svg)](https://jitpack.io/#Digidemic/kyaml)
1) Add JitPack to your project's root `build.gradle` at the end of `repositories`:
- ```groovy
// adds only kyaml.aar
implementation fileTree(dir: "libs", include: ["kyaml.aar"])
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
```
2) In the `build.gradle` of the module(s) you wish to use Kyaml with, add the following to `dependencies`:
- ```groovy
dependencies {
// Required: Installs the .aar without any documentation.
implementation 'com.github.digidemic:kyaml:1.1.0'
// Optional: Displays documentation while writing coding.
implementation 'com.github.digidemic:kyaml:1.1.0:javadoc'
// OR
// adds all .aar files in your libs directory.
implementation fileTree(dir: "libs", include: ["*.aar"])
// Optional: Displays documentation (more comprehensive than javadoc in some cases) and uncompiled code when stepping into library.
implementation 'com.github.digidemic:kyaml:1.1.0:sources'
}
```
4) [Sync gradle](https://www.delasign.com/blog/how-to-sync-an-android-project-with-its-gradle-files-in-android-studio/) successfully.
5) Done! Your Android project is now ready to use Kyaml. Go to [Usage / Examples](#usage--examples) or [Syntax](#syntax) for Kyaml usage!

### Install with gradle (Remote)
>Coming soon!
3) [Sync gradle](https://www.delasign.com/blog/how-to-sync-an-android-project-with-its-gradle-files-in-android-studio/) successfully.
4) Done! Your Android project is now ready to use Kyaml. Go to [Examples](#usage--examples) or [Syntax](#syntax) for Kyaml usage!

<br>

Expand Down
3 changes: 0 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '8.0.2' apply false
id 'com.android.library' version '8.0.2' apply false
id 'org.jetbrains.kotlin.android' version '1.7.20' apply false
}
4 changes: 2 additions & 2 deletions example-kyaml/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'com.android.application'version '8.0.2'
id 'org.jetbrains.kotlin.android' version '1.7.20'
}

android {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Kyaml v1.0.0 - https://github.com/Digidemic/Kyaml
* Kyaml v1.1.0 - https://github.com/Digidemic/kyaml
* (c) 2024 DIGIDEMIC, LLC - All Rights Reserved
* Kyaml developed by Adam Steinberg of DIGIDEMIC, LLC
* License: Apache License 2.0
Expand Down
2 changes: 2 additions & 0 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
jdk:
- openjdk17
Binary file removed kyaml.aar
Binary file not shown.
54 changes: 50 additions & 4 deletions kyaml/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
id 'com.android.library' version '8.0.2'
id 'org.jetbrains.kotlin.android' version '1.6.20'
id 'maven-publish'
}

android {
namespace 'com.digidemic.kyaml'
compileSdk 33

defaultConfig {
minSdk 16
targetSdk 33
minSdk 4
targetSdk 34

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand All @@ -28,6 +29,12 @@ android {
kotlinOptions {
jvmTarget = '1.8'
}

publishing {
singleVariant("release") {
withJavadocJar()
}
}
}

dependencies {
Expand All @@ -37,4 +44,43 @@ dependencies {
testImplementation 'junit:junit:4.13.2'
testImplementation "io.mockk:mockk-android:1.13.5"
testImplementation "io.mockk:mockk-agent:1.13.5"
}

afterEvaluate {
android.libraryVariants.each {variant ->
publishing.publications.create(variant.name, MavenPublication){
from components.findByName(variant.name)

groupId = 'com.github.kyaml'
artifactId = "kyaml"
version = '1.1.0'

pom {
name = 'Kyaml'
description = 'A simple, flexible, and forgiving YAML parser for Android'
url = 'https://github.com/Digidemic/kyaml'

licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}

developers {
developer {
id = 'Digidemic'
name = 'Adam Steinberg'
email = '[email protected]'
}
}

scm {
connection = 'scm:git://github.com/Digidemic/kyaml.git'
developerConnection = 'scm:git://github.com/Digidemic/kyaml.git'
url = 'git://github.com/Digidemic/kyaml.git'
}
}
}
}
}
3 changes: 1 addition & 2 deletions kyaml/src/main/java/com/digidemic/kyaml/Kyaml.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Kyaml v1.0.0 - https://github.com/Digidemic/Kyaml
* Kyaml v1.1.0 - https://github.com/Digidemic/kyaml
* (c) 2024 DIGIDEMIC, LLC - All Rights Reserved
* Kyaml developed by Adam Steinberg of DIGIDEMIC, LLC
* License: Apache License 2.0
Expand Down Expand Up @@ -538,7 +538,6 @@ class Kyaml {
* 6) List<String>("null", "two", "three") -> SequenceType(ValueType.STRING, true)
* 7) List<String>("1", "two", "true") -> SequenceType(ValueType.STRING, false)
*/

@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
@Suppress("KotlinConstantConditions")
internal fun getSequenceType(list: List<String>): SequenceType {
Expand Down

0 comments on commit e7bf6e5

Please sign in to comment.