Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions .bazelproject
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,16 @@ targets:
//javatests/...
-//jstests/...

build_flags:
--config=dev
--config=labs
--define=project=elide-ai

ts_config_rules:
//:tsconfig.json
//defs/toolchain/ts:tsconfig-common
//defs/toolchain/ts:tsconfig-node
//defs/toolchain/ts:tsconfig-browser

test_sources:
- */tests/*
Expand Down
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.1.0
4.2.1
44 changes: 38 additions & 6 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,40 @@

steps:
- command: "make build CI=yes QUIET=no"
label: ":bazel: Build: Framework"
key: framework-build
label: ":bazel: Build: Framework (Linux)"
key: framework-build-linux
agents:
"gcp:project-id": "cookies-co"

- command: "make build test report-coverage report-tests CI=yes QUIET=no"
label: ":coverage: Testsuite"
depends_on: framework-build
- command: "make build CI=yes QUIET=no"
label: ":bazel: Build: Framework (macOS)"
key: framework-build-macos
agents:
os_flavor: "macos"

# report-coverage report-tests
- command: "make test report-coverage CI=yes QUIET=no"
label: ":coverage: Testsuite (Linux)"
depends_on: framework-build-linux
env:
CODECOV_TOKEN: "8942c419-eb75-46a4-8f08-abfaadd11bb5"
CC_TEST_REPORTER_ID: "9d5646c30c5e1f267b4a7a6ae4d6aedb22edc797e87845564b812812fff81f3c"
artifact_paths:
- "reports/coverage/index.html"
- "reports/coverage.tar.gz"
- "reports/tests.xml.html"
agents:
"gcp:project-id": "cookies-co"

- command: "make test CI=yes QUIET=no"
label: ":coverage: Testsuite (macOS)"
depends_on: framework-build-macos
artifact_paths:
- "reports/coverage/index.html"
- "reports/coverage.tar.gz"
- "reports/tests.xml.html"
agents:
os_flavor: "macos"

- command: "make build CI=yes TARGETS='//samples/rest_mvc/java:MicronautMVCSample-native-bin' && make build CI=yes TARGETS='//samples/soy_ssr/src:MicronautSSRSample-native-bin'"
label: ":java: Build: Native Binaries"
Expand All @@ -35,7 +59,14 @@ steps:
- wait

- command: "docker pull us.gcr.io/elide-ai/base/alpine"
label: ":docker: Pull Bases"
label: ":docker: Pull Bases: Alpine"
agents:
"gcp:project-id": "cookies-co"

- command: "docker pull us.gcr.io/elide-ai/base/node"
label: ":docker: Pull Bases: Node"
agents:
"gcp:project-id": "cookies-co"

- command: "make build samples CI=yes"
label: ":gcloud: Publish: Images"
Expand Down Expand Up @@ -76,3 +107,4 @@ steps:
label: ":docker: Release: Docker"
depends_on: native-build
if: build.tag != null

17 changes: 17 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ plugins:
config:
file: "tools/checkstyle.xml"
checks:
com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck:
enabled: false
com.puppycrawl.tools.checkstyle.checks.naming.ClassTypeParameterNameCheck:
enabled: false
com.puppycrawl.tools.checkstyle.checks.naming.MethodTypeParameterNameCheck:
enabled: false
com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck:
enabled: false
com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyLineSeparatorCheck:
Expand Down Expand Up @@ -123,6 +129,10 @@ plugins:
sonar-java:
enabled: true
checks:
squid:S00107:
enabled: false
squid:S3358:
enabled: false
squid:S3776:
enabled: false
squid:SwitchLastCaseIsDefaultCheck:
Expand Down Expand Up @@ -159,4 +169,11 @@ exclude_patterns:
- "**/vendor/"
- "**/*_test.go"
- "**/*.d.ts"
- "docs/"
- "docs/**.*"
- "tests/"
- "tests/**.*"
- "*tests/**.*"
- "javatests/"
- "jstests/"

12 changes: 12 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

FROM us-docker.pkg.dev/cookies-eng/public/base/codespaces:v1h

ENV SHELL=zsh \
HOME=/home/dev \
DEVCONTAINER=yes

USER dev
WORKDIR /home/dev

COPY defs/container.bazelrc /home/dev/bazelrc.remote

14 changes: 14 additions & 0 deletions .devcontainer/Dockerfile.gitpod
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

FROM us-docker.pkg.dev/cookies-eng/public/base/gitpod:latest

ENV SHELL=zsh \
C6S_CODESPACES_VERSION=v1a \
HOME=/home/gitpod \
DEVCONTAINER=yes

RUN echo "Installing BuildBuddy credentials..." \
&& echo "$BUILDBUDDY_CERT" > /home/dev/buildbuddy-cert.pem \
&& echo "$BUILDBUDDY_KEY" > /home/dev/buildbuddy-key.pem;

COPY defs/container.bazelrc /home/gitpod/.bazelrc

31 changes: 31 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"build": {
"dockerfile": "./Dockerfile",
"context": ".."
},
"containerEnv": {
"DEVCONTAINER": "yes",
"HOME": "/home/dev",
"GOOGLE_APPLICATION_CREDENTIALS": "/home/dev/.config/gcloud/application_default_credentials.json"
},
"postCreateCommand": "bash tools/container-init.sh",
"postAttachCommand": "make help",
"containerUser": "dev",
"extensions": [
"BazelBuild.vscode-bazel",
"bufbuild.vscode-buf",
"redhat.java",
"redhat.vscode-commons",
"redhat.vscode-yaml",
"StackBuild.bazel-stack-vscode",
"TeamHub.teamhub",
"VisualStudioExptTeam.vscodeintellicode",
"vscjava.vscode-java-debug",
"vscjava.vscode-java-dependency",
"vscjava.vscode-java-pack",
"vscjava.vscode-java-test",
"vscjava.vscode-maven",
"zhengrenzhe.nyan-cat",
"zxh404.vscode-proto3"
]
}
13 changes: 13 additions & 0 deletions .ijwb/.run/Bazel Testsuite.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Bazel Testsuite" type="BlazeCommandRunConfigurationType" factoryName="Bazel Command">
<blaze-settings handler-id="BlazeCommandGenericRunConfigurationHandlerProvider" kind="java_test" context-element="$PROJECT_DIR$/../javatests/gust/backend/model/ModelMetadataTest.java#testResolveQualifiedName" blaze-command="test">
<blaze-target>//javatests:suite</blaze-target>
<blaze-user-flag>--config=dev</blaze-user-flag>
<blaze-user-flag>--combined_report=lcov</blaze-user-flag>
<blaze-user-flag>--test_output=errors</blaze-user-flag>
</blaze-settings>
<method v="2">
<option name="Blaze.BeforeRunTask" enabled="true" />
</method>
</configuration>
</component>
41 changes: 31 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ ENABLE_REPORTCI ?= yes
JS_COVERAGE_REPORT ?= no
REPORTS ?= reports
CI_REPO ?= sgammon/elide
DEVCONTAINER ?= $(shell echo $$DEVCONTAINER)

SAMPLES ?= //samples/rest_mvc/java:MicronautMVCSample //samples/soy_ssr/src:MicronautSSRSample

Expand All @@ -54,13 +55,12 @@ OUTPATH ?= $(DISTPATH)/out
BINPATH ?= $(DISTPATH)/bin
UNZIP ?= $(shell which unzip)
REVISION ?= $(shell git describe --abbrev=7 --always --tags HEAD)
BASE_VERSION ?= v1b
BASE_VERSION ?= v2a
VERSION ?= $(shell (cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]' | sed 's/version\://g'))
CHROME_COVERAGE ?= $(shell find dist/out/$(OUTPUT_BASE)/bin -name "coverage*.dat" | grep chrome | xargs)
COVERAGE_DATA ?= $(OUTPATH)/_coverage/_coverage_report.dat
COVERAGE_REPORT ?= $(REPORTS)/coverage
COVERAGE_ARGS ?= --function-coverage \
--branch-coverage \
--highlight \
--demangle-cpp \
--show-details \
Expand All @@ -74,7 +74,7 @@ COVERAGE_ARGS ?= --function-coverage \
APP ?=
TARGETS ?= //java/... //gust/... //style/...
LABS_TARGETS ?= //js/...
TESTS ?= //javatests:suite
TESTS ?= //javatests:suite //tests:suite
LABS_TESTS ?= //jstests/...
COVERABLE ?= $(TESTS)

Expand Down Expand Up @@ -168,15 +168,29 @@ LN ?= $(shell which ln)
CURL ?= $(shell which curl)
CHMOD ?= $(shell which chmod)
MKDIR ?= $(shell which mkdir)
BAZELISK ?= $(ENV)/bin/bazelisk
GENHTML ?= $(shell which genhtml)
DOCKER ?= $(shell which docker)

ifeq ($(DEVCONTAINER),yes)
BAZELISK ?= $(shell which bazelisk)
IBAZEL ?= $(shell which ibazel)
else
BAZELISK ?= $(ENV)/bin/bazelisk
IBAZEL ?= $(ENV)/bin/ibazel
endif

PYTHON ?= $(shell which python)
VIRTUALENV ?= $(shell which virtualenv)

# Flag: `CI`
ifeq ($(CI),yes)
TAG += --config=ci
else
TAG += --config=dev
ifeq ($(DEVCONTAINER),yes)
TAG += --config=dev --config=labs
else
TAG += --config=dev-local --config=labs
endif
endif

# Flag: `DEBUG`
Expand All @@ -202,7 +216,11 @@ endif

all: devtools build test ## Build and test all framework targets.

ifeq ($(DEVCONTAINER),yes)
build:
else
build: $(ENV) ## Build all framework targets.
endif
$(info Building $(PROJECT_NAME)...)
$(_RULE)$(BAZELISK) $(BAZELISK_ARGS) build $(TAG) $(BASE_ARGS) $(BUILD_ARGS) -- $(TARGETS)

Expand All @@ -218,11 +236,11 @@ clean: clean-docs clean-reports ## Clean ephemeral targets.

clean-docs: ## Clean built documentation.
@echo "Cleaning docs..."
$(_RULE)rm -fr $(POSIX_FLAGS) $(DOCS)
$(_RULE)rm -fr $(POSIX_FLAGS) $(DOCS)/java

clean-reports: ## Clean built reports.
@echo "Cleaning reports..."
$(_RULE) -fr $(POSIX_FLAGS) $(REPORTS)
$(_RULE)rm -fr $(POSIX_FLAGS) $(REPORTS)

bases: ## Build base images and push them.
@echo "Building Alpine base ('$(BASE_VERSION)')..."
Expand Down Expand Up @@ -287,8 +305,7 @@ serve-coverage: ## Serve the current coverage report (must generate first).

report-tests: ## Report test results to Report.CI.
@echo "Scanning for test results..."
$(_RULE)pip install -r tools/requirements.txt
$(_RULE)find dist/out/$(OUTPUT_BASE) -name test.xml | xargs python3 tools/merge_test_results.py reports/tests.xml
$(_RULE)find dist/out/$(OUTPUT_BASE) -name test.xml | xargs $(ENV)/bin/python tools/merge_test_results.py reports/tests.xml
@echo "Generating HTML test report..."
$(_RULE)cd reports && python3 -m junit2htmlreport tests.xml
ifeq ($(ENABLE_REPORTCI),yes)
Expand Down Expand Up @@ -348,6 +365,10 @@ $(ENV):
$(_RULE)$(LN) -s $(ENV)/bazel/ibazel-$(PLATFORM) $(ENV)/bin/ibazel
$(_RULE)$(CHMOD) +x $(ENV)/bazel/bazelisk-$(PLATFORM) $(ENV)/bin/bazelisk $(ENV)/bazel/ibazel-$(PLATFORM) $(ENV)/bin/ibazel
$(_RULE)$(ENV)/bin/bazelisk version
@echo "Creating virtualenv..."
$(_RULE)$(VIRTUALENV) $(ENV)/python --python=$(PYTHON)
$(_RULE)$(LN) -s $(ENV)/python/bin/python3 $(ENV)/bin/python
$(_RULE)$(ENV)/python/bin/pip install -r $(PWD)/tools/requirements.txt
@echo "Build environment ready."

## Crypto
Expand All @@ -366,5 +387,5 @@ decrypt: $(BUILDKEY_PLAINTEXT) ## Decrypt private key material.
@echo "Key material decrypted."


.PHONY: build test help samples release-images update-deps devtools
.PHONY: build test help samples release-images update-deps devtools docs

5 changes: 3 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ java_import(
)



#
# Extensions
#
Expand Down Expand Up @@ -147,7 +146,9 @@ graal_bindist_repository(

## Java Repos/Deps
load("//defs/toolchain/java:repos.bzl", "gust_java_repositories")
gust_java_repositories()
gust_java_repositories(
maven_install_json = "@gust//:maven_install.json",
)

load("@maven//:compat.bzl", "compat_repositories")
compat_repositories()
Expand Down
Loading