Skip to content

Commit

Permalink
Updated dependencies and updated to use refreshVersions for dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
chRyNaN committed Apr 11, 2023
1 parent ffff805 commit 0e26d03
Show file tree
Hide file tree
Showing 16 changed files with 485 additions and 48 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@chRyNaN
1 change: 1 addition & 0 deletions .github/funding.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
custom: [ "https://www.buymeacoffee.com/chrynan", "https://chrynan.codes" ]
24 changes: 24 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Build

on:
release:
types: [ published ]

jobs:
build:
runs-on: macos-latest

steps:
- name: Checkout Code
uses: actions/checkout@v1

- name: Set up JDK 1.8
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11

- name: Gradle Build
env:
KEY: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew build
26 changes: 26 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish

on:
release:
types: [ published ]

jobs:
build:
runs-on: macos-latest

steps:
- name: Checkout Code
uses: actions/checkout@v1

- name: Set up JDK 1.8
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11

- name: Gradle Publish
env:
KEY: ${{ secrets.GITHUB_TOKEN }}
BINTRAY_USER: ${{ secrets.repsyUsername }}
BINTRAY_KEY: ${{ secrets.repsyToken }}
run: ./gradlew publish
59 changes: 59 additions & 0 deletions .github/workflows/refreshVersions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: RefreshVersions

on:
workflow_dispatch:
schedule:
- cron: '0 7 * * 1'

jobs:
"Refresh-Versions":
runs-on: macos-latest
timeout-minutes: 15
steps:
- id: step-0
name: check-out
uses: actions/checkout@v3
with:
ref: develop

- id: step-1
name: setup-java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: adopt

- id: step-2
name: create-branch
uses: peterjgrainger/[email protected]
with:
branch: dependency-update
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- id: step-3
name: gradle refreshVersions
uses: gradle/gradle-build-action@v2
with:
arguments: refreshVersions

- id: step-4
name: Commit
uses: EndBug/add-and-commit@v9
with:
author_name: GitHub Actions
author_email: [email protected]
message: Refresh versions.properties
new_branch: dependency-update
push: --force --set-upstream origin dependency-update

- id: step-5
name: Pull Request
uses: repo-sync/pull-request@v2
with:
source_branch: dependency-update
destination_branch: develop
pr_title: Upgrade Gradle dependencies
pr_body: '[refreshVersions](https://github.com/jmfayard/refreshVersions) has found these library updates!'
pr_draft: true
github_token: ${{ secrets.GITHUB_TOKEN }}
34 changes: 34 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Keenan"
given-names: "Christopher"
alias: chRyNaN
website: "https://chrynan.codes"
contact:
- family-names: "Keenan"
given-names: "Christopher"
alias: chRyNaN
website: "https://chrynan.codes"
title: "presentation"
type: "software"
abstract: "Kotlin Multi-platform Presentation Layer Design Pattern Library"
license: Apache-2.0
keywords:
- kotlin
- ui
- presentation
- "design-patterns"
- "design-pattern"
- mvi
- mvvm
- viewmodel
- viewmodels
- "kotlin-library"
- "kotlin-multiplatform"
- architecture
- "kotlin-multiplatform-library"
- "kotlin-multiplatform-mobile"
- "mvi-kotlin"
repository-code: "https://github.com/chRyNaN/presentation"
url: "https://github.com/chRyNaN/presentation"
128 changes: 128 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[email protected].
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
76 changes: 76 additions & 0 deletions CODING_CONVENTIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Coding Conventions

Coding conventions are meant to enforce consistency throughout an application's code base. This consistency makes the
code base easier to read, navigate, and maintain. However, coding conventions should not become a hindrance to a
developers creativity and productivity. Striking the balance between having clean and consistent code and allowing
developer creativity, freedom over implementation details, and promoting a productive development environment is a
difficult task. This convention tries to find that balance, but may change over time to better reflect that goal.

## Code Review Process

To promote consistency throughout the codebase, it is considered appropriate to mention violations of the coding
conventions during a code review. This will bring awareness and help keep the code consistent. However, while it is
recommended to fix these violations, minor and inconsistent coding convention deviations shouldn't hold up the merging
of a PR. Remember to follow the [Code of Conduct](CODE_OF_CONDUCT.md) when contributing to this project, including code
review comments.

## Project's Coding Conventions

This project follows a slightly modified version of
the [Kotlin Coding Conventions](https://kotlinlang.org/docs/coding-conventions.html). This helps enforce code
consistency throughout the project. The modifications to the
standard [Kotlin Coding Conventions](https://kotlinlang.org/docs/coding-conventions.html)
are outlined below. These modifications override any conflicting convention from the Kotlin standard conventions.

In the absence of a coding convention, it is the developer's choice. If this occurs constantly for the same style,
consider adding it to this documentation.

## Modifications

The following are the modifications to
the [Kotlin Coding Conventions](https://kotlinlang.org/docs/coding-conventions.html) that this repository utilizes for
it's coding conventions.

### Blank line after type declaration

There must be a blank line after the type declaration and before the first line of code in a file. This helps
readability by making the class declaration more clear at a glance.

#### Example

```kotlin
interface AudioFocusHandler {

fun request()
}
```

### No blank lines before last closing brace

There must not be a blank line before the last closing brace of a type or function.

#### Example

```kotlin
class MyViewModel(...) : BaseViewModel() {

override fun bind() {
...
}
}
```

### Properties are declared before functions

All properties must be declared before functions. This includes private properties. This makes it easier to find
properties and functions without having to search around the file.

### Public functions declared before private functions

All public functions must be declared before the private functions. This allows for quicker understanding of the public
facing functions for the file or type.

### Nested types are declared last for a type

All nested types, such as interfaces, classes, and objects, are declared after all properties and functions of a type.
This allows for quicker understanding of the public facing functions for the file or type.
17 changes: 11 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,20 @@ buildscript {
maven { url = uri("https://repo.repsy.io/mvn/chrynan/public") }
}
dependencies {
classpath("com.android.tools.build:gradle:4.2.2")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20")
classpath("org.jetbrains.kotlin:kotlin-serialization:1.7.20")
classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.7.20")
classpath("org.jetbrains.compose:compose-gradle-plugin:1.3.0-beta03")
classpath("org.jetbrains.compose:compose-gradle-plugin:1.4.0-rc03")
}
}

apply(plugin = "org.jetbrains.dokka")
plugins {
kotlin("jvm") version "1.8.10" apply false
kotlin("multiplatform") version "1.8.10" apply false
kotlin("android") version "1.8.10" apply false
kotlin("plugin.serialization") version "1.8.10" apply false
id("com.android.library") version "7.3.1" apply false
id("com.android.application") version "7.3.1" apply false
id("org.jetbrains.dokka") version "1.8.10"
id("com.vanniktech.dependency.graph.generator") version "0.7.0"
}

allprojects {
repositories {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.chrynan.presentation.buildSrc

import java.lang.System

/**
* Determines if this Gradle build is running on a Mac OSX Operating System.
*/
fun isBuildingOnOSX(): Boolean {
val osName = System.getProperty("os.name").toLowerCase()

return osName.contains("mac os x") || osName.contains("darwin") || osName.contains("osx")
}
Loading

0 comments on commit 0e26d03

Please sign in to comment.