Skip to content

Commit

Permalink
Merge branch 'master' of github.com:google/android-fhir into 2075-x-f…
Browse files Browse the repository at this point in the history
…hir-query-support-for-variable
  • Loading branch information
FikriMilano committed Nov 23, 2023
2 parents 2525cd1 + 704d753 commit a277d01
Show file tree
Hide file tree
Showing 69 changed files with 3,857 additions and 611 deletions.
3 changes: 0 additions & 3 deletions .github/actions/commonSetup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ runs:
with:
distribution: temurin
java-version: "17"
- name: Make files executable
shell: bash
run: chmod +x ./gradlew

- name: "Setup Gradle"
uses: gradle/gradle-build-action@v2
Expand Down
44 changes: 30 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

name: "GitHub Actions: Build"
name: "Build"

# Controls when the action will run. Triggers the workflow on push or pull request
# events for the `master` branch
Expand All @@ -22,49 +22,65 @@ on:
tags:
build*
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
# Run once a week (even if no new code or PRs) to detect random regressions
- cron: '12 13 * * 2'

env:
# Allow precise monitoring of the save/restore of Gradle User Home by `gradle-build-action`
# See https://github.com/marketplace/actions/gradle-build-action?version=v2.1.1#cache-debugging-and-analysis
GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: "fhir" # change this to invalidate cache
# A workflow run is made up of one or more jobs that can run sequentially or in parallel

concurrency:
# github.head_ref uniquely identifies Pull Requests (but is not available when building branches like main or master)
# github.ref is the fallback used when building for workflows triggered by push
# Note that || are fallback values (not "concatenations")
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true # Use e.g. ${{ github.ref != 'refs/heads/main' }} (or master, until #2180) to only cancel for PRs not on branch

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# Build will compile APK, test APK and run tests, lint, etc.
build:
runs-on: ubuntu-22.04-8core
timeout-minutes: 60
permissions:
actions: read
contents: read

runs-on: ubuntu-22.04-64core
strategy:
fail-fast: false

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Cancel previous
uses: styfle/cancel-workflow-action@0.7.0
with:
access_token: ${{ github.token }}

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# Fetch origin/master for spotless ratchet to work
# https://github.com/diffplug/spotless/issues/1242
fetch-depth: 0

- name: Setup machine
uses: ./.github/actions/commonSetup

- name: Spotless check
run: ./gradlew spotlessCheck --scan --stacktrace
run: ./gradlew spotlessCheck --scan --full-stacktrace

- name: Build with Gradle
run: ./gradlew build --scan --stacktrace
- name: Build (full) with Gradle
run: ./gradlew build --scan --full-stacktrace

- name: Check with Gradle
run: ./gradlew check --scan --stacktrace
run: ./gradlew check --scan --full-stacktrace

- name: Release artifacts to local repo
run: ./gradlew publishReleasePublicationToCIRepository --scan
- name: Upload maven repo
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: maven-repository
path: build/ci-repo
Expand All @@ -76,7 +92,7 @@ jobs:
# Upload the build dir for all the modules for diagnosis
- name: Upload build dir
if: ${{ failure() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: build
path: build.zip
27 changes: 25 additions & 2 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: "CodeQL"

# NB: This GitHub Action for https://codeql.github.com seems to be
# a bit "special"; it does not appear to be (easily) possible to just
# integrate and run this as part of the main build.yaml action; see
# https://github.com/google/android-fhir/issues/2310.

on:
push:
branches: [ "master" ]
Expand All @@ -9,10 +28,14 @@ on:
schedule:
- cron: '32 13 * * 2'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref || || github.run_id }}
cancel-in-progress: true

jobs:
analyze:
name: Analyze
runs-on: ubuntu-22.04-64core
runs-on: ubuntu-22.04-8core
timeout-minutes: 60
permissions:
actions: read
Expand All @@ -26,7 +49,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Switch to Java 17 from Eclipse Temurin distro
uses: actions/setup-java@v3
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/runFlank.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
#
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# Fail on any error.
set -e

lib_names=("workflow:benchmark" "engine:benchmark" "datacapture" "engine" "knowledge" "workflow")
firebase_pids=()

for lib_name in "${lib_names[@]}"; do
./gradlew :$lib_name:runFlank --scan --stacktrace &
firebase_pids+=("$!")
done

for firebase_pid in ${firebase_pids[*]}; do
wait $firebase_pid
done
10 changes: 5 additions & 5 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ repositories {
}

dependencies {
implementation("com.diffplug.spotless:spotless-plugin-gradle:6.21.0")
implementation("com.diffplug.spotless:spotless-plugin-gradle:6.22.0")

implementation("com.android.tools.build:gradle:8.1.2")
implementation("com.android.tools.build:gradle:8.1.4")

implementation("app.cash.licensee:licensee-gradle-plugin:1.3.0")
implementation("app.cash.licensee:licensee-gradle-plugin:1.8.0")
implementation("com.osacky.flank.gradle:fladle:0.17.4")

implementation("com.spotify.ruler:ruler-gradle-plugin:1.2.1")
implementation("com.spotify.ruler:ruler-gradle-plugin:1.4.0")

implementation("ca.uhn.hapi.fhir:hapi-fhir-structures-r4:6.8.0")
implementation("com.squareup:kotlinpoet:1.12.0")
implementation("com.squareup:kotlinpoet:1.14.2")
}
12 changes: 2 additions & 10 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ object Dependencies {
"org.opencds.cqf.fhir:cqf-fhir-utility:${Versions.Cql.clinicalReasoning}"
}

object Glide {
const val glide = "com.github.bumptech.glide:glide:${Versions.Glide.glide}"
}

object HapiFhir {
const val fhirBase = "ca.uhn.hapi.fhir:hapi-fhir-base:${Versions.hapiFhir}"
const val fhirClient = "ca.uhn.hapi.fhir:hapi-fhir-client:${Versions.hapiFhir}"
Expand Down Expand Up @@ -218,18 +214,14 @@ object Dependencies {
const val clinicalReasoning = "3.0.0-PRE9-SNAPSHOT"
}

object Glide {
const val glide = "4.14.2"
}

object Kotlin {
const val kotlinCoroutinesCore = "1.7.2"
const val stdlib = "1.8.20"
}

const val androidFhirCommon = "0.1.0-alpha05"
const val androidFhirEngine = "0.1.0-beta04"
const val androidFhirKnowledge = "0.1.0-alpha01"
const val androidFhirEngine = "0.1.0-beta05"
const val androidFhirKnowledge = "0.1.0-alpha03"
const val apacheCommonsCompress = "1.21"
const val desugarJdkLibs = "2.0.3"
const val caffeine = "2.9.1"
Expand Down
2 changes: 2 additions & 0 deletions buildSrc/src/main/kotlin/LicenseeConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ fun Project.configureLicensee() {
apply(plugin = "app.cash.licensee")
configure<app.cash.licensee.LicenseeExtension> {
allow("Apache-2.0")
allow("BSD-2-Clause")
allow("BSD-3-Clause")
allow("MIT")

ignoreDependencies("com.ibm.icu", "icu4j") {
Expand Down
6 changes: 3 additions & 3 deletions buildSrc/src/main/kotlin/Releases.kt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ object Releases {

object Engine : LibraryArtifact {
override val artifactId = "engine"
override val version = "0.1.0-beta04"
override val version = "0.1.0-beta05"
override val name = "Android FHIR Engine Library"
}

Expand All @@ -60,7 +60,7 @@ object Releases {

object Workflow : LibraryArtifact {
override val artifactId = "workflow"
override val version = "0.1.0-alpha03"
override val version = "0.1.0-alpha04"
override val name = "Android FHIR Workflow Library"
}

Expand All @@ -74,7 +74,7 @@ object Releases {

object Knowledge : LibraryArtifact {
override val artifactId = "knowledge"
override val version = "0.1.0-alpha02"
override val version = "0.1.0-alpha03"
override val name = "Android FHIR Knowledge Manager Library"
}

Expand Down
37 changes: 22 additions & 15 deletions codelabs/datacapture/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ plugins {
}

android {
compileSdk = 31
namespace = "com.google.codelab.sdclibrary"
compileSdk = 34

defaultConfig {
applicationId = "com.google.android.fhir.codelabs.datacapture"
minSdk = 24
targetSdk = 31
targetSdk = 34
versionCode = 1
versionName = "1.0"

Expand All @@ -22,24 +23,30 @@ android {
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
buildFeatures {
buildConfig = true
viewBinding = true
}
kotlinOptions {
jvmTarget = "1.8"
compileOptions {
// Flag to enable support for the new language APIs
// See https://developer.android.com/studio/write/java8-support
isCoreLibraryDesugaringEnabled = true
}

packaging { resources.excludes.addAll(listOf("META-INF/ASL-2.0.txt", "META-INF/LGPL-3.0.txt")) }
kotlin { jvmToolchain(11) }
}

dependencies {
implementation("androidx.core:core-ktx:1.7.0")
implementation("androidx.appcompat:appcompat:1.4.0")
implementation("com.google.android.material:material:1.4.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.2")

testImplementation("junit:junit:4.+")
androidTestImplementation("androidx.test.ext:junit:1.1.3")
androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0")
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.3")
implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.10.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")

testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")

// 3 Add dependencies for Structured Data Capture Library and Fragment KTX
}
4 changes: 2 additions & 2 deletions codelabs/datacapture/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ buildscript {
gradlePluginPortal()
}
dependencies {
classpath("com.android.tools.build:gradle:7.0.4")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10")
classpath("com.android.tools.build:gradle:8.1.2")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20")

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle.kts files
Expand Down
4 changes: 1 addition & 3 deletions codelabs/datacapture/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,5 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
kotlin.code.style=official
5 changes: 2 additions & 3 deletions codelabs/datacapture/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Fri Jan 28 09:30:50 GMT 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit a277d01

Please sign in to comment.