Skip to content

Commit 84fd2f7

Browse files
Dan Adlerdadler64
Dan Adler
authored andcommitted
Massive clean up and overhaul of the build system to push project to 2.8.0
1 parent 445778e commit 84fd2f7

File tree

527 files changed

+7764
-8111
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

527 files changed

+7764
-8111
lines changed

.editorconfig

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
charset = utf-8
11+
12+
# 4 space indentation
13+
[*.{gradle, java, xml}]
14+
indent_style = space
15+
indent_size = 4
16+
17+
# Tab indentation (no size specified)
18+
[Makefile]
19+
indent_style = tab

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/.idea
44
/target
55
/src/test
6+
/build
67

78
# Build Files
89
dependency-reduced-pom.xml

README.md

+36-19
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<br>
88
</h1>
99

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

1212

1313
<!-- SHIELDS -->
@@ -53,33 +53,50 @@
5353

5454
## About
5555

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

58-
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.
59+
Logisim is an educational tool originally created by Carl Burch and is used for designing and simulating digital logic circuits.
60+
With its simple toolbar interface and simulation of circuits as you build them, it is simple enough to facilitate learning the
61+
most basic concepts related to logic circuits. With the capacity to build larger circuits from smaller subcircuits, and to draw
62+
bundles of wires with a single mouse drag, Logisim can be used (and is used) to design and simulate entire CPUs for educational
63+
purposes.
5964

60-
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.
65+
Logisim is used by students at colleges and universities around the world in many types of classes, ranging from a brief unit on
66+
logic in general-education computer science surveys, to computer organization courses, to full-semester courses on computer
67+
architecture.
6168

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

6471
## Features
6572

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

7686
## How To Use
77-
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.
78-
79-
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.
80-
81-
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.
87+
88+
This project is a WIP and although it is currently building correctly there are
89+
still [issues](https://github.com/dadler64/Logisim/issues) that keep coming up. At this tie, if you are looking for a fully
90+
working program I recommend going to the original [Logisim website](http://www.cburch.com/logisim/) and downloading the stable
91+
builds from there until the builds here are more stable.
92+
93+
The initial release on the releases page is the one from the original Logisim website. I will periodically post ALPHA and BETA
94+
releases so that you can see what is being changed as this project progresses.
95+
96+
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
97+
it in there using the build system provided.
8298

8399
## Contributing
84100

85-
For now if you would like to contribute check out any open [issues](https://github.com/dadler64/Logisim/issues) which could be resolved.
101+
For now if you would like to contribute check out any open [issues](https://github.com/dadler64/Logisim/issues) which could be
102+
resolved.

build.gradle

+91-99
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,36 @@ buildscript {
44
}
55

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

11+
plugins {
12+
id "nebula.ospackage" version "8.5.6"
13+
id "edu.sc.seis.launch4j" version "2.4.9"
14+
}
15+
1416
apply plugin: 'java'
1517
apply plugin: 'distribution'
16-
apply plugin: 'edu.sc.seis.launch4j'
17-
apply plugin: 'nebula.ospackage'
1818

1919
// Common Configuration //
20-
rootProject.version='2.8.0'
21-
targetCompatibility='1.8'
20+
project.version = '2.8.0'
21+
22+
project.ext.author = 'Dan Adler'
23+
project.ext.email = '<[email protected]>'
24+
project.ext.copyright = '(C) 2021'
25+
project.ext.description = 'Logisim Circuit Simulator'
26+
project.ext.url = 'https://github.com/dadler64/Logisim'
27+
project.ext.bundleId = 'com.cburch.logisim'
28+
project.ext.mainClass = "${project.ext.bundleId}.Main"
29+
project.ext.resPath = '/src/main/resources'
2230

2331
allprojects {
2432
apply plugin: 'eclipse'
2533
apply plugin: 'idea'
2634

2735
tasks.withType(JavaCompile) {
28-
sourceCompatibility = targetCompatibility = '1.8'
36+
sourceCompatibility = targetCompatibility = '1.10'
2937
options.compilerArgs << '-Xlint:deprecation'
3038
options.compilerArgs << '-Xlint:unchecked'
3139
options.encoding = 'UTF-8'
@@ -48,110 +56,106 @@ cleanIdea.doFirst {
4856
followSymLinks = true
4957
}
5058

51-
subprojects.each { subproject ->
52-
evaluationDependsOn(subproject.path)
53-
}
54-
5559
// All in one JAR file //
5660
jar {
57-
def deps = []
58-
59-
subprojects.each { subproject ->
60-
from subproject.sourceSets.main.output.classesDirs
61-
from subproject.sourceSets.main.output.resourcesDir
62-
deps += subproject.configurations.runtime - subproject.configurations.provided
63-
}
64-
subprojects.each { subproject ->
65-
deps -= subproject.jar.archivePath
66-
}
67-
deps = deps.unique().collect {it.isDirectory() ? it : zipTree(it)}
68-
from deps
69-
7061
manifest {
71-
attributes 'Main-Class': 'com.cburch.logisim.Main',
72-
'SplashScreen-Image': 'src/main/resources/logisim/img/logisim-icon-128.png',
73-
'Logisim-Version': project.version
62+
attributes 'Main-Class': project.ext.mainClass, 'JD-FX-Version': project.version
7463
}
7564

7665
duplicatesStrategy DuplicatesStrategy.EXCLUDE
66+
67+
// This line of code recursively collects and copies all of a project's files
68+
// and adds them to the JAR itself. One can extend this task, to skip certain
69+
// files or particular types at will
70+
from {
71+
configurations.compileClasspath.collect {
72+
it.isDirectory() ? it : zipTree(it)
73+
}
74+
}
7775
}
7876

7977
// Java executable wrapper for Windows //
8078
launch4j {
8179
createExe.dependsOn 'jar'
8280

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

92-
// Packages for Linux //
93-
//ospackage {
94-
// buildDeb.dependsOn 'proguard'
95-
// buildRpm.dependsOn 'proguard'
96-
// buildDeb.dependsOn 'jar'
97-
// buildRpm.dependsOn 'jar'
98-
//
99-
// license = file('LICENSE')
100-
// maintainer 'Dan Adler <[email protected]>'
101-
// os LINUX
102-
// packageDescription 'Continuation on the Logisim circuit simulator'
103-
// packageGroup 'java'
104-
// packageName 'logisim'
105-
// release '0'
106-
// summary 'Software Simulator'
107-
// url 'https://github.com/dadler64/logisim'
108-
//
109-
// logger.debug('/opt/' + project.name)
110-
// into '/opt/' + project.name
111-
// from (jar) {
112-
// fileMode 0755
113-
// }
114-
// from ('dist/linux/resources/') {
115-
// fileMode 0755
116-
// }
117-
// from 'LICENSE', 'README.md'
118-
//
119-
// postInstall 'cd /opt/' + project.name + '; ln -s ./' + file(jar).name + ' ./pennsim.jar; ' +
120-
// 'xdg-icon-resource install --size 128 --novendor ./PenSimIcon.png pennsim; xdg-desktop-menu install ./*.desktop'
121-
// preUninstall 'cd /opt/' + project.name + '; rm -f ./jd-gui.jar; rm -fr ./ext; xdg-desktop-menu uninstall ./*.desktop'
122-
//}
123-
12490
// Distributions for MacOS and Windows //
12591
distributions {
12692

12793
osx.contents {
128-
into('Logisim.app/Contents') {
129-
into('Logisim.app/Contents/Resources') {
130-
from('dist/macos/resources') {
131-
include 'logisim.icns'
94+
// info.plist file
95+
into("${rootProject.name}.app/Contents") {
96+
if (file("./dist/macos/Info.plist").exists()) {
97+
from('./dist/macos') {
98+
include 'Info.plist'
99+
expand VERSION: project.version,
100+
JAR: project.name,
101+
COPYRIGHT: project.ext.copyright,
102+
AUTHOR: project.ext.author,
103+
BUNDLE_ID: project.ext.bundleId,
104+
MAIN_CLASS: project.ext.mainClass
105+
}
106+
} else {
107+
println("WARNING: Unable to locate the \'Info.plist\' file!\nMacOS bundled app may not work!")
108+
}
109+
}
110+
// universalJavaApplicationStub.sh
111+
into("${rootProject.name}.app/Contents/MacOS") {
112+
if (file("./dist/macos/universalJavaApplicationStub.sh").exists()) {
113+
from('./dist/macos') {
114+
include 'universalJavaApplicationStub.sh'
115+
fileMode 0755
132116
}
117+
} else {
118+
println("WARNING: Unable to locate the \'universalJavaApplicationStub.sh\' file!\nMacOS bundled app may not work!")
133119
}
134-
from('dist/macos/resources') {
135-
include 'Info.plist'
136-
expand VERSION: project.version,
137-
// JAR: file(proguard.outJarFiles[0]).name
138-
JAR: jar.baseName
120+
}
121+
// App *.icns file
122+
into("${rootProject.name}.app/Contents/Resources") {
123+
String iconFileName = "${rootProject.name}App"
124+
if (file("./dist/macos/${iconFileName}.icns").exists()) {
125+
from('./dist/macos') {
126+
// Make sure this matches the name of the .icns file in the 'dist/macos/resources/' folder
127+
include "${iconFileName}.icns"
128+
}
129+
} else {
130+
println("WARNING: Unable to locate icon for MacOS app at: <./dist/macos/resources/${rootProject.name}.icns>!")
139131
}
140132
}
141-
into('Logisim.app/Contents/MacOS') {
142-
from('dist/macos/resources') {
143-
include 'universalJavaApplicationStub.sh'
144-
fileMode 0755
133+
// Document *.icns file
134+
into("${rootProject.name}.app/Contents/Resources") {
135+
String iconFileName = "${rootProject.name}Doc"
136+
if (file("./dist/macos/${iconFileName}.icns").exists()) {
137+
from('./dist/macos') {
138+
// Make sure this matches the name of the .icns file in the 'dist/macos/resources/' folder
139+
include "${iconFileName}.icns"
140+
}
141+
} else {
142+
println("WARNING: Unable to locate icon for MacOS app at: <./dist/macos/resources/${rootProject.name}.icns>!")
145143
}
146144
}
147-
into('Logisim.app/Contents/Resources/Java') {
145+
// project *.jar file
146+
into("${rootProject.name}.app/Contents/Resources/Java") {
148147
from jar
149148
}
150149
from 'LICENSE', 'README.md'
151150
}
152151

153152
windows.contents {
154-
from 'build/launch4j/Logisim.exe'
153+
from "build/launch4j/${project.name}.exe"
154+
from 'LICENSE', 'README.md'
155+
}
156+
157+
crossplatform.contents {
158+
from "build/libs/${project.name}-${project.version}.jar"
155159
from 'LICENSE', 'README.md'
156160
}
157161

@@ -162,25 +166,13 @@ distributions {
162166
installOsxDist.dependsOn 'jar'
163167
osxDistTar.dependsOn 'jar'
164168
osxDistZip.dependsOn 'jar'
165-
}
166-
167-
//build.finalizedBy buildDeb
168-
//build.finalizedBy buildRpm
169169

170-
171-
//====================
172-
// Local Dependencies
173-
//====================
174-
repositories {
175-
flatDir {
176-
dirs 'libs'
177-
}
170+
// Use this cross platform build until linux building resumes
171+
installCrossplatformDist.dependsOn 'jar'
172+
crossplatformDistTar.dependsOn 'jar'
173+
crossplatformDistZip.dependsOn 'jar'
178174
}
179175

180176
dependencies {
181-
compile name: 'ColorPicker'
182-
compile name: 'FontChooser'
183-
compile name: 'JavaHelp'
184-
compile name: 'Logger-1.0.0'
185-
compile name: 'MRJAdapter'
186-
}
177+
implementation fileTree(dir: 'libs', include: ('*.jar'))
178+
}

dist/linux/Logisim.png

963 Bytes
Loading

dist/linux/logisim.desktop

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Desktop Entry]
2+
Comment=COMMENT
3+
Terminal=TERMINAL
4+
Name=NAME
5+
Exec=java -jar /opt/logisim/JAR_FILE
6+
Type=Application
7+
Icon=NAME.png
8+
MimeType=application/java;application/java-vm;application/java-archive
9+
StartupWMClass=MAIN_CLASS

dist/linux/resources/logisim.desktop

-9
This file was deleted.

0 commit comments

Comments
 (0)