Skip to content

Commit

Permalink
Merge Develop (#6) (#7)
Browse files Browse the repository at this point in the history
* Merge Develop (#6)

* Add take home pay for all time periods

* Add tax free to payload

* Tidy up gradle

* Fix TODOs and a general fix up

* Format :)

* Move files and add task for code coverage and building of the tests

* Add minimum coverage percentage of 95%

* Fix deprecation warnings

* Add in CustomExceptions

* Fix coverage issues

* Make hours per week Double? with null default

* Fix cleanBuildTestCoverage

* Fix some general kotlin warnings

* Add publish to Bintray functionality

* Add version badge and update docs now this is on Bintray

* Add build labelling to handle BITRISE_GIT_TAG

* Fix merge issues
  • Loading branch information
georgeherby authored Aug 28, 2019
1 parent 8622869 commit 6c20968
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 25 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ out
gen
build
.gradle
/credentials.properties
local.properties
29 changes: 12 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@

# tax-kalculator

#### Version
[ ![Download](https://api.bintray.com/packages/hmrc/mobile-releases/tax-kalculator/images/download.svg) ](https://bintray.com/hmrc/mobile-releases/tax-kalculator/_latestVersion)

##### Code Coverages
![LINE](https://img.shields.io/badge/line--coverage-97%25-brightgreen.svg)
![LINE](https://img.shields.io/badge/line--coverage-98%25-brightgreen.svg)
![BRANCH](https://img.shields.io/badge/branch--coverage-94%25-brightgreen.svg)
![COMPLEXITY](https://img.shields.io/badge/complexity-1.37-brightgreen.svg)
![COMPLEXITY](https://img.shields.io/badge/complexity-1.46-brightgreen.svg)

##### Build Status

[![Build Status](https://app.bitrise.io/app/cd7fb52c258b9273/status.svg?token=lntO8o4xz5AUEvLwVzbo3A&branch=master)](https://app.bitrise.io/app/cd7fb52c258b9273)
Expand All @@ -19,25 +23,16 @@ The gradle task to run before commit that runs a clean, build, test, coverage an

Just add the framework to the project all dependencies are bundled

### Android

Add `jcenter()` to `allProjects.repository` in the root `build.gradle`

In the app module `build.gradle` add the following line to your `dependencies`:
### Android or JVM

Add the following to `repositories` in your modules `build.gradle`
```groovy
implementation "uk.gov.hmrc:tax-kalculator-jvm:0.0.4" //Update Version
maven {
url "https://hmrc.bintray.com/mobile-releases"
}
```

### JVM

Add `jcenter()` to `repositories` in the root `build.gradle`

In the module `build.gradle` add the following line to your `dependencies`:

```groovy
implementation "uk.gov.hmrc:tax-kalculator-jvm:0.0.4" //Update Version
```
In the app module `build.gradle` add the following line to your `dependencies`:

## Using library

Expand Down
47 changes: 39 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
id 'com.github.dawnwords.jacoco.badge' version '0.1.0'
id 'io.gitlab.arturbosch.detekt' version '1.0.0-RC16'
id 'com.diffplug.gradle.spotless' version '3.24.0'
id "com.jfrog.bintray" version "1.8.4"
}

jacocoBadgeGenSetting {
Expand Down Expand Up @@ -47,8 +48,16 @@ repositories {
}
}

static def getDate() {
def date = new Date()
def formattedDate = date.format('yyyyMMddHHmm')
return formattedDate
}

group 'uk.gov.hmrc'
version '0.0.1'
description='Multiplatform Tax Calculator library'
version=System.getenv('BITRISE_GIT_TAG') ?: ("SNAPSHOT-" + getDate() )


apply plugin: 'maven-publish'
String frameworkName = 'TaxKalculator'
Expand Down Expand Up @@ -171,12 +180,31 @@ task "testCommonUnitTestCoverage"(type: JacocoReport, dependsOn: "allTests") {
}
}


task cleanBuildTestCoverage(type: GradleBuild) {
tasks = ['clean', 'cleanAllTests', 'build','testCommonUnitTestCoverage', 'generateJacocoBadge', 'jacocoTestCoverageVerification']
}

def license = '''\
Properties credentials = new Properties()
rootProject.file("credentials.properties").withInputStream { credentials.load(it) }

bintray {
user = credentials.getProperty('bintray.user')
key = credentials.getProperty('bintray.apikey')

publications = ['jvm', 'metadata']

pkg {
repo = 'mobile-releases'
name = project.name
userOrg = 'hmrc'
desc = project.description
licenses = ['Apache-2.0']
version {
name = project.version
released = new Date()
}

def license = '''\
/*
* Copyright $YEAR HM Revenue & Customs
*
Expand All @@ -194,10 +222,13 @@ def license = '''\
*/
'''

spotless {
kotlin {
target "**/*.kt"
ktlint()
licenseHeader license
spotless {
kotlin {
target "**/*.kt"
ktlint()
licenseHeader license

}
}
}
}
3 changes: 3 additions & 0 deletions credentials.properties.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# For when you want to deploy to Bintray
bintray.user = YOUR BINTRAY USER ID
bintray.apikey = YOUR BINTRAY API

0 comments on commit 6c20968

Please sign in to comment.