Skip to content

Commit

Permalink
Add junit5-jupiter-starter-bazel sample
Browse files Browse the repository at this point in the history
PR: #79
  • Loading branch information
hcoona authored and sormuras committed Oct 31, 2018
1 parent c486903 commit d0cc227
Show file tree
Hide file tree
Showing 13 changed files with 510 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
language: java
jdk: oraclejdk8

addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8'
key_url: 'https://bazel.build/bazel-release.pub.gpg'
packages:
- bazel

jobs:
include:
# starter
Expand All @@ -19,6 +28,9 @@ jobs:
- stage: starter
name: "Jupiter Starter Sample: Maven"
script: cd $TRAVIS_BUILD_DIR/junit5-jupiter-starter-maven && ./mvnw test
- stage: starter
name: "Jupiter Starter Sample: Bazel"
script: cd $TRAVIS_BUILD_DIR/junit5-jupiter-starter-bazel && bazel test //...
- stage: starter
name: "Jupiter Extension Samples"
script: cd $TRAVIS_BUILD_DIR/junit5-jupiter-extensions && ./gradlew test --console plain
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ Groovy programming language.
The [junit5-jupiter-starter-maven] sample demonstrates the bare minimum configuration for
getting started with JUnit Jupiter using the Maven build system.

### Jupiter on Bazel ![badge-jdk-8] ![badge-tool-bazel] ![badge-junit-jupiter]

The [junit5-jupiter-starter-bazel] sample demonstrates the bare minimum configuration for getting started with JUnit Jupiter using the Bazel build system.

## Jupiter Feature Samples

Expand Down Expand Up @@ -84,6 +87,7 @@ for the JUnit Platform using the Java Platform Module System.
[junit5-jupiter-starter-gradle-groovy]: junit5-jupiter-starter-gradle-groovy
[junit5-jupiter-starter-gradle-kotlin]: junit5-jupiter-starter-gradle-kotlin
[junit5-jupiter-starter-maven]: junit5-jupiter-starter-maven
[junit5-jupiter-starter-bazel]: junit5-jupiter-starter-bazel
[junit5-migration-gradle]: junit5-migration-gradle
[junit5-migration-maven]: junit5-migration-maven
[junit5-multiple-engines]: junit5-multiple-engines
Expand All @@ -96,6 +100,7 @@ for the JUnit Platform using the Java Platform Module System.
[badge-tool-ant]: https://img.shields.io/badge/tool-ant-10f0f0.svg "Ant"
[badge-tool-gradle]: https://img.shields.io/badge/tool-gradle-blue.svg "Gradle wrapper included"
[badge-tool-maven]: https://img.shields.io/badge/tool-maven-0440af.svg "Maven wrapper included"
[badge-tool-bazel]: https://img.shields.io/badge/tool-bazel-43a047.svg "Bazel"
[badge-tool-console]: https://img.shields.io/badge/tool-console-022077.svg "Command line tools"
[badge-junit-platform]: https://img.shields.io/badge/junit-platform-brightgreen.svg "JUnit Platform"
[badge-junit-jupiter]: https://img.shields.io/badge/junit-jupiter-green.svg "JUnit Jupiter Engine"
Expand Down
281 changes: 281 additions & 0 deletions junit5-jupiter-starter-bazel/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,281 @@

# Created by https://www.gitignore.io/api/vim,java,linux,macos,maven,bazel,eclipse,windows,intellij+all,visualstudiocode

### Bazel ###
/bazel-*

### Eclipse ###

.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# PyDev specific (Python IDE for Eclipse)
*.pydevproject

# CDT-specific (C/C++ Development Tooling)
.cproject

# CDT- autotools
.autotools

# Java annotation processor (APT)
.factorypath

# PDT-specific (PHP Development Tools)
.buildpath

# sbteclipse plugin
.target

# Tern plugin
.tern-project

# TeXlipse plugin
.texlipse

# STS (Spring Tool Suite)
.springBeans

# Code Recommenders
.recommenders/

# Annotation Processing
.apt_generated/

# Scala IDE specific (Scala & Java development for Eclipse)
.cache-main
.scala_dependencies
.worksheet

### Eclipse Patch ###
# Eclipse Core
.project

# JDT-specific (Eclipse Java Development Tools)
.classpath

# Annotation Processing
.apt_generated

### Intellij+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

### Intellij+all Patch ###
# Ignores the whole .idea folder and all .iml files
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360

.idea/

# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023

*.iml
modules.xml
.idea/misc.xml
*.ipr

### Java ###
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Maven ###
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar

### Vim ###
# Swap
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]

# Session
Session.vim

# Temporary
.netrwhist
# Auto-generated tag files
tags
# Persistent undo
[._]*.un~

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

### Windows ###
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk


# End of https://www.gitignore.io/api/vim,java,linux,macos,maven,bazel,eclipse,windows,intellij+all,visualstudiocode
Empty file.
4 changes: 4 additions & 0 deletions junit5-jupiter-starter-bazel/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# junit5-jupiter-starter-bazel

The `junit5-jupiter-starter-bazel` project demonstrates how to execute JUnit Jupiter
tests using Bazel.
19 changes: 19 additions & 0 deletions junit5-jupiter-starter-bazel/WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
load("@bazel_tools//tools/build_defs/repo:maven_rules.bzl", "maven_dependency_plugin", "maven_jar")
load(":junit5.bzl", "junit_jupiter_java_repositories", "junit_platform_java_repositories")

maven_server(
name = "default",
url = "http://central.maven.org/maven2/",
)

JUNIT_JUPITER_VERSION = "5.2.0"

JUNIT_PLATFORM_VERSION = "1.2.0"

junit_jupiter_java_repositories(
version = JUNIT_JUPITER_VERSION,
)

junit_platform_java_repositories(
version = JUNIT_PLATFORM_VERSION,
)
Loading

0 comments on commit d0cc227

Please sign in to comment.