Skip to content

Commit

Permalink
Merge branch 'develop' into 'master'
Browse files Browse the repository at this point in the history
Pull everything from GitHub

See merge request life/pddl-planning-android!5
  • Loading branch information
Victor PALEOLOGUE committed May 4, 2021
2 parents 80de577 + c0ecd20 commit 6a22dea
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 5 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/continuous-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Android CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'

- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
36 changes: 36 additions & 0 deletions .github/workflows/tagged-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: "Release from tag"

on:
push:
tags:
- "v*"

jobs:
gh_tagged_release:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'

- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew assembleRelease


- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
LICENSE
pddl-planning/build/outputs/aar/*.aar
pddl-planning-test/build/outputs/aar/*.aar
id: "automatic_releases"

2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ android.enableJetifier=true
kotlin.code.style=official

POM_GROUP_ID=com.softbankrobotics
VERSION_NAME=1.3.0
VERSION_NAME=1.4.0
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ open class Instance(override val name: String) : Named, Typed, Expression(name)
/** PDDL representation of the declaration of the instance. */
fun declaration(): String {
// When type is omitted in PDDL, it already means "object"
val typeSpecifier = if (type != Companion.type) " - ${type.name}" else ""
val typeSpecifier = if (type != Companion.type) " - ${type.name}" else " - object"
return "$this$typeSpecifier"
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.softbankrobotics.pddlplanning.utils

import com.softbankrobotics.pddlplanning.LogFunction
import com.softbankrobotics.pddlplanning.*

/**
Expand Down Expand Up @@ -54,8 +53,11 @@ fun applyParameters(expression: Expression, parameters: Map<Instance, Instance>)
*/
private fun parseParameter(expression: Expression): Instance {
val parameterDeclaration = expression.word
val matches = Regex("([\\w?]+) - (\\w+)").matchEntire(parameterDeclaration)!!
val (name, type) = matches.groupValues.subList(1, matches.groupValues.size)
val matches = Regex("([\\w?]+)\\s*?-?\\s*?(\\w+)?").matchEntire(parameterDeclaration)
?: throw RuntimeException("parameter declaration is badly formed: \"$parameterDeclaration\"")
val stringMatches = matches.groupValues
val name = stringMatches[1]
val type = if (stringMatches.size > 2) stringMatches[2] else "object"
return Instance.create(name, type)
}

Expand Down

0 comments on commit 6a22dea

Please sign in to comment.