Skip to content

Commit

Permalink
Massive clean up and overhaul of the build system to push project to …
Browse files Browse the repository at this point in the history
…2.8.0
  • Loading branch information
Dan Adler authored and dadler64 committed Apr 9, 2021
1 parent 445778e commit 84fd2f7
Show file tree
Hide file tree
Showing 527 changed files with 7,764 additions and 8,111 deletions.
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8

# 4 space indentation
[*.{gradle, java, xml}]
indent_style = space
indent_size = 4

# Tab indentation (no size specified)
[Makefile]
indent_style = tab
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/.idea
/target
/src/test
/build

# Build Files
dependency-reduced-pom.xml
Expand Down
55 changes: 36 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<br>
</h1>

<h4 align="center">A backup of the original Logisim circuit simulator.</h4>
<h4 align="center">A continuation of the original Logisim circuit simulator by Carl Burch.</h4>


<!-- SHIELDS -->
Expand Down Expand Up @@ -53,33 +53,50 @@

## About

This is a backup of the original Logisim source code which can be found on the original [Logisim website](http://www.cburch.com/logisim/).
This is a backup of the original Logisim source code which can be found on the
original [Logisim website](http://www.cburch.com/logisim/).

Logisim is an educational tool for designing and simulating digital logic circuits. With its simple toolbar interface and simulation of circuits as you build them, it is simple enough to facilitate learning the most basic concepts related to logic circuits. With the capacity to build larger circuits from smaller subcircuits, and to draw bundles of wires with a single mouse drag, Logisim can be used (and is used) to design and simulate entire CPUs for educational purposes.
Logisim is an educational tool originally created by Carl Burch and is used for designing and simulating digital logic circuits.
With its simple toolbar interface and simulation of circuits as you build them, it is simple enough to facilitate learning the
most basic concepts related to logic circuits. With the capacity to build larger circuits from smaller subcircuits, and to draw
bundles of wires with a single mouse drag, Logisim can be used (and is used) to design and simulate entire CPUs for educational
purposes.

Logisim is used by students at colleges and universities around the world in many types of classes, ranging from a brief unit on logic in general-education computer science surveys, to computer organization courses, to full-semester courses on computer architecture.
Logisim is used by students at colleges and universities around the world in many types of classes, ranging from a brief unit on
logic in general-education computer science surveys, to computer organization courses, to full-semester courses on computer
architecture.

This is a continuation of the original project since original development was ceased in October of 2014.

## Features

* It runs on any machine supporting Java 8 or later; special versions are to be released later for MacOS X, Linux, and Windows. The cross-platform nature is important for students who have a variety of home/dorm computer systems.
* The drawing interface is based on an intuitive toolbar. Color-coded wires aid in simulating and debugging a circuit.
* The wiring tool draws horizontal and vertical wires, automatically connecting to components and to other wires. It's very easy to draw circuits!
* Completed circuits can be saved into a file, exported to a GIF file, or printed on a printer.
* Circuit layouts can be used as "subcircuits" of other circuits, allowing for hierarchical circuit design.
* Included circuit components include inputs and outputs, gates, multiplexers, arithmetic circuits, flip-flops, and RAM memory.
* The included "combinational analysis" module allows for conversion between circuits, truth tables, and Boolean expressions.

See the [Features Status page]() on the project Wiki for information about the status of the above features as well as any additional plans for features
* It is designed to run on any machine supporting Java 10 or later; and each release is packaged for MacOS, Linux, and Windows.
The cross-platform nature is important for students who have a variety of home/school/dorm computer systems.
* The drawing interface is based on an intuitive toolbar. Color-coded wires aid in simulating and debugging a circuit.
* The wiring tool draws horizontal and vertical wires, automatically connecting to components and to other wires. It's very easy
to draw circuits!
* Completed circuits can be saved into a file, exported to a GIF file, or printed on a printer.
* Circuit layouts can be used as "subcircuits" of other circuits, allowing for hierarchical circuit design.
* Included circuit components include inputs and outputs, gates, multiplexers, arithmetic circuits, flip-flops, and RAM memory.
* The included "combinational analysis" module allows for conversion between circuits, truth tables, and Boolean expressions.

See the [Features Status page]() on the project Wiki for information about the status of the above features as well as any
additional plans for features

## How To Use
This project is a WIP and although it is currently building correctly there are still [issues](https://github.com/dadler64/Logisim/issues) that keep coming up. At this tie, if you are looking for a fully wokring program I recommend going to the original [Logisim website](http://www.cburch.com/logisim/) and downloading the stable builds from there until the builds here are more stable.

The initial release on the releases page is the one from the original Logisim website. I will periodically post ALPHA and BETA releases so that you can see what is being changed as this project progresses.

If you want to try your hand at running or building what is here, import the project into an IDE such as IntelliJ IDEA and build it in there using the build system provided.

This project is a WIP and although it is currently building correctly there are
still [issues](https://github.com/dadler64/Logisim/issues) that keep coming up. At this tie, if you are looking for a fully
working program I recommend going to the original [Logisim website](http://www.cburch.com/logisim/) and downloading the stable
builds from there until the builds here are more stable.

The initial release on the releases page is the one from the original Logisim website. I will periodically post ALPHA and BETA
releases so that you can see what is being changed as this project progresses.

If you want to try your hand at running or building what is here, import the project into an IDE such as IntelliJ IDEA and build
it in there using the build system provided.

## Contributing

For now if you would like to contribute check out any open [issues](https://github.com/dadler64/Logisim/issues) which could be resolved.
For now if you would like to contribute check out any open [issues](https://github.com/dadler64/Logisim/issues) which could be
resolved.
190 changes: 91 additions & 99 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,36 @@ buildscript {
}

dependencies {
classpath fileTree(dir: 'libs', include: '*.jar')
classpath 'com.yuvimasory:orange-extensions:1.3.0' // OSX support
classpath 'com.netflix.nebula:gradle-ospackage-plugin:8.1.0' // https://plugins.gradle.org/plugin/nebula.ospackage
classpath 'edu.sc.seis.gradle:launch4j:2.4.6' // https://plugins.gradle.org/plugin/edu.sc.seis.launch4j
classpath 'com.yuvimasory:orange-extensions:1.3.0' // OSX support
}
}

plugins {
id "nebula.ospackage" version "8.5.6"
id "edu.sc.seis.launch4j" version "2.4.9"
}

apply plugin: 'java'
apply plugin: 'distribution'
apply plugin: 'edu.sc.seis.launch4j'
apply plugin: 'nebula.ospackage'

// Common Configuration //
rootProject.version='2.8.0'
targetCompatibility='1.8'
project.version = '2.8.0'

project.ext.author = 'Dan Adler'
project.ext.email = '<[email protected]>'
project.ext.copyright = '(C) 2021'
project.ext.description = 'Logisim Circuit Simulator'
project.ext.url = 'https://github.com/dadler64/Logisim'
project.ext.bundleId = 'com.cburch.logisim'
project.ext.mainClass = "${project.ext.bundleId}.Main"
project.ext.resPath = '/src/main/resources'

allprojects {
apply plugin: 'eclipse'
apply plugin: 'idea'

tasks.withType(JavaCompile) {
sourceCompatibility = targetCompatibility = '1.8'
sourceCompatibility = targetCompatibility = '1.10'
options.compilerArgs << '-Xlint:deprecation'
options.compilerArgs << '-Xlint:unchecked'
options.encoding = 'UTF-8'
Expand All @@ -48,110 +56,106 @@ cleanIdea.doFirst {
followSymLinks = true
}

subprojects.each { subproject ->
evaluationDependsOn(subproject.path)
}

// All in one JAR file //
jar {
def deps = []

subprojects.each { subproject ->
from subproject.sourceSets.main.output.classesDirs
from subproject.sourceSets.main.output.resourcesDir
deps += subproject.configurations.runtime - subproject.configurations.provided
}
subprojects.each { subproject ->
deps -= subproject.jar.archivePath
}
deps = deps.unique().collect {it.isDirectory() ? it : zipTree(it)}
from deps

manifest {
attributes 'Main-Class': 'com.cburch.logisim.Main',
'SplashScreen-Image': 'src/main/resources/logisim/img/logisim-icon-128.png',
'Logisim-Version': project.version
attributes 'Main-Class': project.ext.mainClass, 'JD-FX-Version': project.version
}

duplicatesStrategy DuplicatesStrategy.EXCLUDE

// This line of code recursively collects and copies all of a project's files
// and adds them to the JAR itself. One can extend this task, to skip certain
// files or particular types at will
from {
configurations.compileClasspath.collect {
it.isDirectory() ? it : zipTree(it)
}
}
}

// Java executable wrapper for Windows //
launch4j {
createExe.dependsOn 'jar'

version = textVersion = project.version
fileDescription = productName = 'Logisim'
errTitle 'Logisim Windows Wrapper'
copyright 'Dan Adler (C) 2019,2020'
fileDescription = 'Continuation on the Logisim circuit simulator'
icon projectDir.path + '/src/main/resources/logisim/img/logisim-icon.ico'
fileDescription = productName = rootProject.name
errTitle = "${rootProject.name} Wrapper"
copyright = "${project.ext.author} ${project.ext.copyright}"
fileDescription = project.ext.description
icon = "${projectDir.path}/dist/windows/${project.name}.ico"
bundledJrePath = '%JAVA_HOME%'
}

// Packages for Linux //
//ospackage {
// buildDeb.dependsOn 'proguard'
// buildRpm.dependsOn 'proguard'
// buildDeb.dependsOn 'jar'
// buildRpm.dependsOn 'jar'
//
// license = file('LICENSE')
// maintainer 'Dan Adler <[email protected]>'
// os LINUX
// packageDescription 'Continuation on the Logisim circuit simulator'
// packageGroup 'java'
// packageName 'logisim'
// release '0'
// summary 'Software Simulator'
// url 'https://github.com/dadler64/logisim'
//
// logger.debug('/opt/' + project.name)
// into '/opt/' + project.name
// from (jar) {
// fileMode 0755
// }
// from ('dist/linux/resources/') {
// fileMode 0755
// }
// from 'LICENSE', 'README.md'
//
// postInstall 'cd /opt/' + project.name + '; ln -s ./' + file(jar).name + ' ./pennsim.jar; ' +
// 'xdg-icon-resource install --size 128 --novendor ./PenSimIcon.png pennsim; xdg-desktop-menu install ./*.desktop'
// preUninstall 'cd /opt/' + project.name + '; rm -f ./jd-gui.jar; rm -fr ./ext; xdg-desktop-menu uninstall ./*.desktop'
//}

// Distributions for MacOS and Windows //
distributions {

osx.contents {
into('Logisim.app/Contents') {
into('Logisim.app/Contents/Resources') {
from('dist/macos/resources') {
include 'logisim.icns'
// info.plist file
into("${rootProject.name}.app/Contents") {
if (file("./dist/macos/Info.plist").exists()) {
from('./dist/macos') {
include 'Info.plist'
expand VERSION: project.version,
JAR: project.name,
COPYRIGHT: project.ext.copyright,
AUTHOR: project.ext.author,
BUNDLE_ID: project.ext.bundleId,
MAIN_CLASS: project.ext.mainClass
}
} else {
println("WARNING: Unable to locate the \'Info.plist\' file!\nMacOS bundled app may not work!")
}
}
// universalJavaApplicationStub.sh
into("${rootProject.name}.app/Contents/MacOS") {
if (file("./dist/macos/universalJavaApplicationStub.sh").exists()) {
from('./dist/macos') {
include 'universalJavaApplicationStub.sh'
fileMode 0755
}
} else {
println("WARNING: Unable to locate the \'universalJavaApplicationStub.sh\' file!\nMacOS bundled app may not work!")
}
from('dist/macos/resources') {
include 'Info.plist'
expand VERSION: project.version,
// JAR: file(proguard.outJarFiles[0]).name
JAR: jar.baseName
}
// App *.icns file
into("${rootProject.name}.app/Contents/Resources") {
String iconFileName = "${rootProject.name}App"
if (file("./dist/macos/${iconFileName}.icns").exists()) {
from('./dist/macos') {
// Make sure this matches the name of the .icns file in the 'dist/macos/resources/' folder
include "${iconFileName}.icns"
}
} else {
println("WARNING: Unable to locate icon for MacOS app at: <./dist/macos/resources/${rootProject.name}.icns>!")
}
}
into('Logisim.app/Contents/MacOS') {
from('dist/macos/resources') {
include 'universalJavaApplicationStub.sh'
fileMode 0755
// Document *.icns file
into("${rootProject.name}.app/Contents/Resources") {
String iconFileName = "${rootProject.name}Doc"
if (file("./dist/macos/${iconFileName}.icns").exists()) {
from('./dist/macos') {
// Make sure this matches the name of the .icns file in the 'dist/macos/resources/' folder
include "${iconFileName}.icns"
}
} else {
println("WARNING: Unable to locate icon for MacOS app at: <./dist/macos/resources/${rootProject.name}.icns>!")
}
}
into('Logisim.app/Contents/Resources/Java') {
// project *.jar file
into("${rootProject.name}.app/Contents/Resources/Java") {
from jar
}
from 'LICENSE', 'README.md'
}

windows.contents {
from 'build/launch4j/Logisim.exe'
from "build/launch4j/${project.name}.exe"
from 'LICENSE', 'README.md'
}

crossplatform.contents {
from "build/libs/${project.name}-${project.version}.jar"
from 'LICENSE', 'README.md'
}

Expand All @@ -162,25 +166,13 @@ distributions {
installOsxDist.dependsOn 'jar'
osxDistTar.dependsOn 'jar'
osxDistZip.dependsOn 'jar'
}

//build.finalizedBy buildDeb
//build.finalizedBy buildRpm


//====================
// Local Dependencies
//====================
repositories {
flatDir {
dirs 'libs'
}
// Use this cross platform build until linux building resumes
installCrossplatformDist.dependsOn 'jar'
crossplatformDistTar.dependsOn 'jar'
crossplatformDistZip.dependsOn 'jar'
}

dependencies {
compile name: 'ColorPicker'
compile name: 'FontChooser'
compile name: 'JavaHelp'
compile name: 'Logger-1.0.0'
compile name: 'MRJAdapter'
}
implementation fileTree(dir: 'libs', include: ('*.jar'))
}
Binary file added dist/linux/Logisim.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions dist/linux/logisim.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Desktop Entry]
Comment=COMMENT
Terminal=TERMINAL
Name=NAME
Exec=java -jar /opt/logisim/JAR_FILE
Type=Application
Icon=NAME.png
MimeType=application/java;application/java-vm;application/java-archive
StartupWMClass=MAIN_CLASS
9 changes: 0 additions & 9 deletions dist/linux/resources/logisim.desktop

This file was deleted.

Loading

0 comments on commit 84fd2f7

Please sign in to comment.