Updated CI (#2)

* Updated CI

* Updated CI

* Updated CI

* Updated CI

* Removed wrong method.
This commit is contained in:
Adrian Kuta 2020-01-09 19:08:11 +01:00 committed by GitHub
parent 6a1c33fd02
commit ff6c6ba6e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 59 additions and 16 deletions

View File

@ -1,10 +1,7 @@
version: 2 version: 2.1
jobs: jobs:
build: build:
working_directory: ~/code working_directory: ~/code
branches:
only:
- master
docker: docker:
- image: circleci/android:api-29 - image: circleci/android:api-29
environment: environment:
@ -13,9 +10,6 @@ jobs:
- checkout - checkout
- restore_cache: - restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }} key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
# - run:
# name: Chmod permissions #if permission for Gradlew Dependencies fail, use this.
# command: sudo chmod +x ./gradlew
- run: - run:
name: Download Dependencies name: Download Dependencies
command: ./gradlew androidDependencies command: ./gradlew androidDependencies
@ -23,11 +17,61 @@ jobs:
paths: paths:
- ~/.gradle - ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }} key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
tests:
working_directory: ~/code
docker:
- image: circleci/android:api-29
environment:
JVM_OPTS: -Xmx3200m
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- store_artifacts:
path: app/build/reports
destination: reports
- run:
name: Run Lint Test
command: ./gradlew lint
- run: - run:
name: Run Tests name: Run Tests
command: ./gradlew lint test command: ./gradlew lint test
- store_artifacts: # for display in Artifacts: https://circleci.com/docs/2.0/artifacts/ - store_artifacts:
path: app/build/reports path: app/build/reports
destination: reports destination: reports
- store_test_results: # for display in Test Summary: https://circleci.com/docs/2.0/collect-test-data/ - store_test_results:
path: app/build/test-results path: app/build/test-results
deploy:
working_directory: ~/code
docker:
- image: circleci/android:api-29
environment:
JVM_OPTS: -Xmx3200m
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- run:
command: echo $GPG_KEY_CONTENTS | base64 -d > /secret.gpg
- run:
name: Staging
command: ./gradlew treedatastructure:publishReleasePublicationToSonatypeRepository
workflows:
version: 2.1
build-and-deploy:
jobs:
- build
- deploy:
requires:
- build
filters:
tags:
only:
- /.*/
branches:
only:
- release
- master

View File

@ -3,6 +3,9 @@
<JetCodeStyleSettings> <JetCodeStyleSettings>
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" /> <option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</JetCodeStyleSettings> </JetCodeStyleSettings>
<MarkdownNavigatorCodeStyleSettings>
<option name="RIGHT_MARGIN" value="72" />
</MarkdownNavigatorCodeStyleSettings>
<codeStyleSettings language="XML"> <codeStyleSettings language="XML">
<indentOptions> <indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" /> <option name="CONTINUATION_INDENT_SIZE" value="4" />

View File

@ -1,7 +1,7 @@
# Tree (Data Structure) # Tree (Data Structure)
[![maven](https://img.shields.io/maven-central/v/com.github.adriankuta/tree-structure?style=plastic)](https://mvnrepository.com/artifact/com.github.adriankuta/tree-structure) [![maven](https://img.shields.io/maven-central/v/com.github.adriankuta/tree-structure?style=plastic)](https://mvnrepository.com/artifact/com.github.adriankuta/tree-structure)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue?style=plastic)](https://github.com/AdrianKuta/Design-Patterns-Kotlin/blob/master/LICENSE) [![License: MIT](https://img.shields.io/badge/License-MIT-blue?style=plastic)](https://github.com/AdrianKuta/Design-Patterns-Kotlin/blob/master/LICENSE)
[![CircleCI](https://img.shields.io/circleci/build/github/AdrianKuta/Tree-Data-Structure?label=CircleCI&style=plastic)](https://circleci.com/gh/AdrianKuta/Tree-Data-Structure) [![CircleCI](https://img.shields.io/circleci/build/github/AdrianKuta/Tree-Data-Structure/master?label=CircleCI&style=plastic)](https://circleci.com/gh/AdrianKuta/Tree-Data-Structure)
Simple implementation to store object in tree structure. Method `toString()` is overrided to provide nice tree view in logs. Simple implementation to store object in tree structure. Method `toString()` is overrided to provide nice tree view in logs.

View File

@ -100,7 +100,7 @@ publishing {
maven { maven {
// This is an arbitrary name, you may also use "mavencentral" or // This is an arbitrary name, you may also use "mavencentral" or
// any other name that's descriptive for you // any other name that's descriptive for you
name = "mavencentral" name = "sonatype"
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/" def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"

View File

@ -40,10 +40,6 @@ class TreeNode<T>(val value: T) {
return childrenMaxDepth + 1 return childrenMaxDepth + 1
} }
fun allItems(): List<T> {
return children.map { value }
}
override fun toString(): String { override fun toString(): String {
val stringBuilder = StringBuilder() val stringBuilder = StringBuilder()
print(stringBuilder, "", "") print(stringBuilder, "", "")