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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file renamed CircuitSim1.8.0.jar → CircuitSim1.8.2-austin.jar
Binary file not shown.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ To make your own CircuitSim autograder:
and writing a new `README.md`
2. Edit the project name in `gradle.properties`
3. Write some tests in `src/main/java/edu/gatech/cs2110/circuitsim/tests/`
4. Test with `./gradlew run` and generate `build/libs/hwX-tester.jar`
with `./gradlew jar`
4. Generate `build/image/bin/hwX-tester`, a shell script, with
`./gradlew jlink`
5. Distribute to students the zipped up archive `build/hwX-tester.zip`,
generated by `./gradlew jlinkZip`

### Writing Tests

Expand Down
72 changes: 33 additions & 39 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,60 +1,54 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* user guide available at https://docs.gradle.org/4.7/userguide/tutorial_java_projects.html
*/
// Based on:
// https://github.com/beryx-gist/badass-jlink-example-log4j2-javafx
//
// The jlink task will produce build/image/bin/hwX-tester (a shell script)
// The jlinkZip task will produce build/hwX-tester.zip
//
// More info: https://badass-jlink-plugin.beryx.org/releases/latest/

plugins {
// Apply the java plugin to add support for Java
id 'java'

// Apply the application plugin to add support for building an application
id 'java-library'
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.8'
id 'org.beryx.jlink' version '2.17.0'
}

// Build for Java 8
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
repositories {
mavenCentral()

// Define the main class for the application
mainClassName = 'edu.gatech.cs2110.circuitsim.launcher.TesterLauncher'
flatDir {
dirs '.'
}
}

dependencies {
// Don't need to put gson in here since the CircuitSim jar already
// includes it
compile ':CircuitSim1.8.0:'
compile 'org.junit.jupiter:junit-jupiter-api:5.2.0'
compile 'org.junit.jupiter:junit-jupiter-params:5.2.0'
compile 'org.junit.jupiter:junit-jupiter-engine:5.2.0'
compile 'org.junit.platform:junit-platform-launcher:1.2.0'
implementation 'com.google.code.gson:gson:2.8.6'
implementation ':CircuitSim1.8.2-austin:'
implementation 'org.junit.jupiter:junit-jupiter-api:5.5.2'
implementation 'org.junit.jupiter:junit-jupiter-params:5.5.2'
implementation 'org.junit.jupiter:junit-jupiter-engine:5.5.2'
implementation 'org.junit.platform:junit-platform-launcher:1.5.2'
}

javafx {
version = '13'
modules = ['javafx.controls']
}

compileJava {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}

// In this section you declare where to find the dependencies of your project
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
mainClassName = 'tester/edu.gatech.cs2110.circuitsim.launcher.TesterLauncher'

flatDir {
dirs '.'
jlink {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
imageZip = file("$buildDir/hwX-tester.zip")
launcher {
name = 'hwX-tester'
}
}

jar {
manifest {
attributes('Main-Class': mainClassName)
}

// Include dependencies
from { configurations.testRuntime.collect { it.isDirectory() ? it : zipTree(it) } }
}

javadoc {
title 'CircuitSim Autograder API'
include 'edu/gatech/cs2110/circuitsim/api/*', 'edu/gatech/cs2110/circuitsim/extension/*'
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
51 changes: 31 additions & 20 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 17 additions & 1 deletion gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

import static org.junit.platform.engine.TestExecutionResult.Status.SUCCESSFUL;
import static org.junit.platform.engine.discovery.DiscoverySelectors.selectClass;
import static org.junit.platform.engine.discovery.DiscoverySelectors.selectPackage;
import static org.junit.platform.engine.discovery.DiscoverySelectors.selectModule;

import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.util.List;
import java.util.SortedSet;
import java.util.TreeSet;

Expand All @@ -16,6 +14,7 @@
import org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder;

public class TesterLauncher {
private static final String TEST_MODULE = "tester";
private static final String TEST_PACKAGE = "edu.gatech.cs2110.circuitsim.tests";
private static final int MAX_FAILURES = 8;
private String pkg;
Expand Down Expand Up @@ -147,7 +146,7 @@ private LauncherDiscoveryRequest buildDiscoveryRequest(String testClassName) {
LauncherDiscoveryRequestBuilder builder = new LauncherDiscoveryRequestBuilder();

if (testClassName == null) {
builder.selectors(selectPackage(pkg));
builder.selectors(selectModule(TEST_MODULE));
} else {
String fullyQualifiedClassName = String.format("%s.%s", pkg, testClassName);
builder.selectors(selectClass(fullyQualifiedClassName));
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module tester {
requires javafx.controls;
requires com.google.gson;
requires org.junit.jupiter.api;
requires org.junit.jupiter.params;
requires org.junit.jupiter.engine;
requires org.junit.platform.launcher;
requires circuitsim;

exports edu.gatech.cs2110.circuitsim.extension;
exports edu.gatech.cs2110.circuitsim.launcher;
exports edu.gatech.cs2110.circuitsim.tests;
}