New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Makefile and CI scripts to remove 'ci' folder and 'ci-' prefix. #130
Conversation
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) lint) | ||
|
||
|
||
ci-build: create-ci |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move below and renamed to "assemble-phone"
(mv $(AAR_FILE_DIR)/$(EXTENSION-LIBRARY-FOLDER-NAME)-phone-release.aar $(AAR_FILE_DIR)/$(MODULE_NAME)-release-$(LIB_VERSION).aar) | ||
(cp -r ./code/$(EXTENSION-LIBRARY-FOLDER-NAME)/build $(BUILD-ASSEMBLE-LOCATION)) | ||
|
||
ci-build-app: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved below and renamed to "assemble-phone"
BUILD-ASSEMBLE-LOCATION = ./ci/assemble | ||
ROOT_DIR=$(shell git rev-parse --show-toplevel) | ||
|
||
PROJECT_NAME = $(shell cat $(ROOT_DIR)/code/gradle.properties | grep "moduleProjectName" | cut -d'=' -f2) | ||
AAR_NAME = $(shell cat $(ROOT_DIR)/code/gradle.properties | grep "moduleAARName" | cut -d'=' -f2) | ||
MODULE_NAME = $(shell cat $(ROOT_DIR)/code/gradle.properties | grep "moduleName" | cut -d'=' -f2) | ||
LIB_VERSION = $(shell cat $(ROOT_DIR)/code/gradle.properties | grep "moduleVersion" | cut -d'=' -f2) | ||
SOURCE_FILE_DIR = $(ROOT_DIR)/code/$(PROJECT_NAME) | ||
AAR_FILE_DIR = $(ROOT_DIR)/code/$(PROJECT_NAME)/build/outputs/aar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the step from "ci-build"/"assemble-phone" which renamed the assembled .aar file, which required all these variables. I don't think we need to rename the .aar anymore as it is not used in the publish task anymore.
Makefile
Outdated
(./code/gradlew -p code/${EXTENSION-LIBRARY-FOLDER-NAME} publishReleasePublicationToSonatypeRepository) | ||
|
||
ci-publish-main: clean build-release | ||
publish-main: clean assemble-phone-release |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've kept this as publish-main
but I'm open to just renaming it publish
, similar to the User Profile project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Userprofile keep them as
ci-publish-staging
ci-publish
Should we follow to make it standard?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to be a mistake that they kept the ci-
prefix just for those two targets. There are other targets which are called in CI which do not use the prefix.
I'm fine with renaming from publish-main
to just publish
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Core team responded saying the ci-
prefix is preserved because these targets are meant to only be run in CI. I've updated the Make file to add the ci-
prefix back while renaming ci-publish-main
to ci-publish
.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## dev-v3.0.0 #130 +/- ##
=============================================
Coverage 84.30% 84.30%
Complexity 406 406
=============================================
Files 30 30
Lines 1643 1643
Branches 235 235
=============================================
Hits 1385 1385
Misses 165 165
Partials 93 93
Flags with carried forward coverage won't be shown. Click here to find out more. |
- store_artifacts: | ||
path: ci/javadoc/build/reports | ||
path: code/edge/build/dokka/javadoc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we put into
code/edge/build/docs/javadoc
as Userprofile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is reading the generated HTML files after running Javadoc. Edge is using Dokka to generate the Javadocs so this is the path where the files are located. We may want to move away from Dokka, as it appears the other extensions using Kotlin are not using it. But if we do, that will be in another PR.
.circleci/config.yml
Outdated
@@ -134,13 +134,12 @@ jobs: | |||
# Code coverage upload using Codecov | |||
# See options explanation here: https://docs.codecov.com/docs/codecov-uploader | |||
- codecov/upload: | |||
file: ci/unit-test/build/reports/jacoco/platformUnitTestJacocoReport/platformUnitTestJacocoReport.xml | |||
file: code/edge/build/reports/jacoco/platformUnitTestJacocoReport/platformUnitTestJacocoReport.xml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about use
code/edge/build/reports/coverage/test/phone/debug/report.xml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That directory doesn't exist in Edge when running the unit tests. Keep in mind I'm only renaming the Makefile targets and I haven't changed the Gradle files. If the common Gradle files change how Jacoco is setup, then these file locations may change later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the Gradle task used to generate the coverage reports and the generated report location. The report location now matches what you suggested. Thanks!
.circleci/config.yml
Outdated
|
||
- android/run-tests: | ||
test-command: make ci-unit-test | ||
test-command: make unit-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Userprofile uses make unit-test-coverage which include running unit test and create coverage. Do you want to include that in this PR or later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear to me that it is needed to have a separate Makefile target which just runs the unit-test without producing a coverage file. I don't see that User Profile is running their unit-test
target, only unit-test-coverage
. I would prefer to keep the target name as unit-test
while having it produce the coverage files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They have both unit-test and unit-test-coverage.
unit-test can be used for running locally.
unit-test-coverage will run both unit test and unit test coverage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the Make file to include coverage and non-coverage testing targets so we are consistent with Core team's implementation.
.circleci/config.yml
Outdated
# The test command | ||
test-command: make ci-functional-test | ||
test-command: make functional-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to change functional-test-coverage now or later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
Makefile
Outdated
(./code/gradlew -p code/${EXTENSION-LIBRARY-FOLDER-NAME} publishReleasePublicationToSonatypeRepository) | ||
|
||
ci-publish-main: clean build-release | ||
publish-main: clean assemble-phone-release |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Userprofile keep them as
ci-publish-staging
ci-publish
Should we follow to make it standard?
…d update report locations in CircleCI config.
Makefile
Outdated
ci-generate-library-release: | ||
(./code/gradlew -p code/${EXTENSION-LIBRARY-FOLDER-NAME} assemblePhoneRelease) | ||
assemble-phone-debug: | ||
(./code/gradlew -p code/${EXTENSION-LIBRARY-FOLDER-NAME} assemblePhoneDebug) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we use {EXTENSION-LIBRARY-FOLDER-NAME}
Or
(EXTENSION-LIBRARY-FOLDER-NAME)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GNU allows both for variable expansion. However we should be consistent, plus some have reported weird errors when mixing both types in the same line. Let's stick with using $()
instead of curly braces.
Description
Update Makefile and CI scripts to remove the "ci" folder during builds and "ci-" prefix in Makefile targets. The use of the "ci" folder is no longer needed. Additionally, the copy step to the "ci" folder may get skipped if an earlier step fails and aborts the task. It is less error prone to reference files directly from the build folders than using the "ci" folder.
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: