Skip to content

Commit

Permalink
Release version 0.0.5
Browse files Browse the repository at this point in the history
Merge pull request #27 from qualersoft/release/0.0.5
  • Loading branch information
mathze committed Jul 2, 2021
2 parents 754c2f0 + 2a055e9 commit f1bec99
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 10 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ jobs:
steps:
- uses: actions/checkout@v2
id: checkout
- name: Extract branch name

- name: "Extract branch name"
id: extract_branch
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"

- name: "Gradle cache"
id: gradle-cache
uses: actions/cache@v2
Expand All @@ -27,16 +29,19 @@ jobs:
~/.gradle/wrapper/dists/**
key: ${{ runner.os }}-gradle-${{ secrets.GRADLE_CACHE_VERSION }}-${{ hashFiles('./*.gradle', './*.gradle.kts', './gradle.properties') }}
restore-keys: ${{ runner.os }}-gradle-${{ secrets.GRADLE_CACHE_VERSION }}-

- name: "Workspace cache"
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/**
key: ${{ runner.os }}-sources-${{ github.run_id }}

- name: "get fossa"
run: |
curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh > install.sh
sudo bash install.sh -b .
- name: init gradle
- name: "init gradle"
if: steps.gradle-cache.outputs.cache-hit != 'true'
run: ./gradlew --no-daemon

Expand All @@ -50,13 +55,15 @@ jobs:
with:
path: ${{ github.workspace }}/**
key: ${{ runner.os }}-sources-${{ github.run_id }}

- name: "Load gradle cache"
uses: actions/cache@v2
with:
path: |
~/.gradle/wrapper/dists/**
key: ${{ runner.os }}-gradle-${{ secrets.GRADLE_CACHE_VERSION }}-${{ hashFiles('./*.gradle', './*.gradle.kts', './gradle.properties') }}
restore-keys: ${{ runner.os }}-gradle-${{ secrets.GRADLE_CACHE_VERSION }}-

- name: "Detekt"
run: ${{ github.workspace }}/gradlew detekt --no-daemon

Expand All @@ -70,6 +77,7 @@ jobs:
with:
path: ${{ github.workspace }}/**
key: ${{ runner.os }}-sources-${{ github.run_id }}

- name: "Fossa analyze"
env:
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}
Expand All @@ -84,17 +92,20 @@ jobs:
with:
path: ${{ github.workspace }}/**
key: ${{ runner.os }}-sources-${{ github.run_id }}

- name: "Load gradle cache"
uses: actions/cache@v2
with:
path: |
~/.gradle/wrapper/dists/**
key: ${{ runner.os }}-gradle-${{ secrets.GRADLE_CACHE_VERSION }}-${{ hashFiles('./*.gradle', './*.gradle.kts', './gradle.properties') }}
restore-keys: ${{ runner.os }}-gradle-${{ secrets.GRADLE_CACHE_VERSION }}-

- uses: actions/cache@v2
with:
path: ${{ github.workspace }}/**
key: ${{ runner.os }}-compile-${{ github.run_id }}

- name: "Compile"
run: ${{ github.workspace }}/gradlew classes --no-daemon

Expand All @@ -107,18 +118,21 @@ jobs:
with:
path: ${{ github.workspace }}/**
key: ${{ runner.os }}-compile-${{ github.run_id }}

- name: "Load gradle cache"
uses: actions/cache@v2
with:
path: |
~/.gradle/wrapper/dists/**
key: ${{ runner.os }}-gradle-${{ secrets.GRADLE_CACHE_VERSION }}-${{ hashFiles('./*.gradle', './*.gradle.kts', './gradle.properties') }}
restore-keys: ${{ runner.os }}-gradle-${{ secrets.GRADLE_CACHE_VERSION }}-

- name: "Unit test cache"
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/**
key: ${{ runner.os }}-test-${{ github.run_id }}

- name: "Unit test"
run: ${{ github.workspace }}/gradlew test --no-daemon

Expand All @@ -131,6 +145,7 @@ jobs:
with:
path: ${{ github.workspace }}/**
key: ${{ runner.os }}-sources-${{ github.run_id }}

- name: "Fossa check license"
env:
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}
Expand All @@ -146,6 +161,7 @@ jobs:
with:
path: ${{ github.workspace }}/**
key: ${{ runner.os }}-test-${{ github.run_id }}

- name: "Publish Report"
run: bash <(curl -s https://codecov.io/bash) -B ${{ needs.init.outputs.branch }}

Expand All @@ -161,13 +177,15 @@ jobs:
with:
path: ${{ github.workspace }}/**
key: ${{ runner.os }}-compile-${{ github.run_id }}

- name: "Load gradle cache"
uses: actions/cache@v2
with:
path: |
~/.gradle/wrapper/dists/**
key: ${{ runner.os }}-gradle-${{ secrets.GRADLE_CACHE_VERSION }}-${{ hashFiles('./*.gradle', './*.gradle.kts', './gradle.properties') }}
restore-keys: ${{ runner.os }}-gradle-${{ secrets.GRADLE_CACHE_VERSION }}-

- name: "Publish"
env:
USERNAME: ${{ github.actor }}
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#Sun Jun 27 08:34:57 UTC 2021
#Fri Jul 02 16:33:35 UTC 2021
org.gradle.jvmargs=-XX\:MaxMetaspaceSize\=512m
version=0.0.4
version=0.0.5
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
package de.qualersoft.robotframework.library.conversion

object BooleanConverter {
private val TRUES = listOf("yes", "true", "on", "ok")
private val FALSES = listOf("", "no", "false", "off", "nok")

fun convertToBoolean(value: Any): Any = when (value) {
is String -> booleanOfString(value)
is Number -> booleanOfNumber(value)
else -> throw IllegalArgumentException("Unexpected type for value <$value>! Only Numbers and some Strings are allowed.")
else -> throw IllegalArgumentException(
"Unexpected type for value <$value>! Only Numbers and some Strings are allowed."
)
}

private val TRUES = listOf("yes", "true", "on", "ok")
private val FALSES = listOf("", "no", "false", "off", "nok")

private fun booleanOfString(value: String): Boolean {
val normalized = value.trim()
return when {
Expand All @@ -36,4 +37,4 @@ object BooleanConverter {
* Simply convert to double and check if value is not equal to zero.
*/
private fun booleanOfNumber(value: Number): Boolean = value.toDouble() != 0.0
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ open class RobotLib(private val root: KClass<*>, vararg args: String) : MinimalD
RfArgumentSpecSupport, RfArgumentTypesSupport, RfLibdocSupport, RfSourceSupport {

private val log: Logger = LoggerFactory.getLogger(javaClass)
private val ctx: ConfigurableApplicationContext
protected val ctx: ConfigurableApplicationContext

private val kwdBeans: List<KClass<*>> by lazy { findKeywordBeans() }

Expand Down Expand Up @@ -126,6 +126,40 @@ open class RobotLib(private val root: KClass<*>, vararg args: String) : MinimalD
return "$pathToJar${File.separatorChar}$classPath"
}

/**
* Return an instance, which may be shared or independent, of the specified bean.
*
* Allows for specifying explicit constructor arguments / factory method arguments,
* overriding the specified default arguments (if any) in the bean definition.
*
* For details see [`BeanFactory.getBean(Class<T>, Object...)`] [org.springframework.beans.factory.BeanFactory.getBean].
*
* @param args arguments to use when creating a bean instance using explicit arguments
*
* @return an instance of the bean
*/
protected inline fun <reified T> getBean(vararg args:Any?): T {
return ctx.getBean(T::class.java, *args)
}

/**
* Return an instance, which may be shared or independent, of the specified bean.
*
* Allows for specifying explicit constructor arguments / factory method arguments,
* overriding the specified default arguments (if any) in the bean definition.
*
* For details see [`BeanFactory.getBean(String, Object...)`] [org.springframework.beans.factory.BeanFactory.getBean].
*
* @param name the name of the bean to retrieve
* @param args arguments to use when creating a bean instance using explicit arguments
* (only applied when creating a new instance as opposed to retrieving an existing one)
*
* @return an instance of the bean
*/
protected fun getBean(name: String, vararg args: Any?): Any {
return ctx.getBean(name, *args)
}

/**
* Meant to be overwritten. Default impl returns empty string
*/
Expand Down

0 comments on commit f1bec99

Please sign in to comment.