Final updates for 2.5.1 and addition of script for creating JAR files (preliminary version)

git-svn-id: https://circuit.svn.sourceforge.net/svnroot/circuit/trunk@48 70edf91d-0b9e-4248-82e7-2488d7716404
This commit is contained in:
Carl Burch 2010-09-02 18:55:05 +00:00
parent faab37c9f1
commit f6b1b25acf
28 changed files with 1190 additions and 13 deletions

View File

@ -1,3 +1,17 @@
LOGISIM 2.5.1 INTRODUCES STATS, IMPROVES GATES
Logisim, a graphical design and simulation tool for logic circuits, is now at version 2.5.1. This release addresses a few significant bugs from the dramatic changes in the 2.5.0 release earlier this week, and it adds a few less significant features. The biggest of the bugs involves how on some platforms Logisim saved (and loaded) projects involving non-ASCII characters. Another bug could occur when loading multiple libraries, at least one of which is a Logisim project itself.
Among the new features is the Project menu's new "Get Circuit Statistics" menu item, which displays a count of how many components are used within the circuit and within its hierarchy. This feature can also be accessed through the command line.
The Gates library receives further attention in this release. Gates can now have up to 32 inputs, and an option has been added so that they can be drawn larger than the default. Also, you can now control on which side the control line is drawn for controlled buffers and controlled inverters. Finally, this version improves how the basic logic gates are drawn in several minor ways; for example, rectangular OR gates are now drawn using the standard label of "greater-than-or-equal 1."
Finally, the integrated help system is now configured to support full-text search capabilities. Also, while not technically part of the download, the on-line documentation available through Logisim's Web page includes a navigation tree, analogous to the integrated help system.
Educational institutions around the world use Logisim as an aid to teaching about digital logic and computer architecture. As a Java application, Logisim can run on most major operating systems. Read more about Logisim at http://www.cburch.com/logisim/, and download it from SourceForge.net at http://sourceforge.net/projects/circuit/.
CHANGE LOG
Feature: Added the "Get Project Statistics" menu item and the "-tty stats" command-line option.
Feature: The integrated help system now includes full-text search. Also, the most recent version of the JavaHelp library is packaged with Logisim.
@ -10,20 +24,22 @@ Feature: Added a third, larger Gate Size option to the multi-input logic gates,
Feature: The color and font dialogs were modified so that their strings could more easily be translated. A Russian translation is included.
Interface change: The rectangular OR and NOR gates are drawn with the proper "≥1" label rather than ">0".
Interface change: The shaped OR, NOR, XOR, and XNOR gates are drawn slightly differently, using Java's GeneralPath class. As a result, the corners connect well and the "wings" for a large number of inputs don't get overly deep.
Bug fix: In 2.5.0, Logisim projects were opened assuming a UTF-8 encoding, and it refused to open files with invalid encoding. It now first attempts opening the file assuming UTF-8 encoding (since that is now the default save format); but if that fails, it attempts to open the file using the platform's default encoding.
Bug fix: An exception occurred when loading multiple Logisim libraries.
Bug fix: An exception could occur when loading multiple libraries into a project, at least one of which is a Logisim file.
Bug fix: It was reported that a race condition could occur when opening many files. (Thanks to Joshua Cranmer of Georgia Tech for providing the report and suggesting changes to fix it.)
Bug fix: In previous versions, projects were saved using the platform's default encoding (even though the XML indicated it used UTF-8), leading files to be non-portable if they included non-ASCII characters. Now the file is always saved using UTF-8.
Bug fix: Using DIN 40700 gate shapes, the OR and NOR gates were drawn improperly for even numbers of inputs.
Bug fix: Using DIN 40700 gate shapes, the OR and NOR gates were drawn improperly for even numbers of inputs, and the NAND and NOR gates' output lines did not quite go as far as their input.
Bug fix: With the font dialog library, changes to the selected language would not be reflected until the program was restarted.
Bug fix: The documentation used the " />" idiom for childless elements like "<br />", but this confuses Java 5 systems (not Java 6) so that the ">" appears in the documentation. All instances of this idiom were removed.
Bug fix: The documentation used the XHTML " />" idiom for childless elements like "<br />", but this confuses Java 5 systems (not Java 6) so that the ">" appears when viewing the pages in the integrated help system. All instances of this idiom were removed.
Interface change: The shaped OR, NOR, XOR, and XNOR gates are drawn slightly differently, using Java's GeneralPath class. As a result, the corners connect well and the "wings" for a large number of inputs don't get overly deep.
Internal modification: All references to the JDOM library were removed, using Java's integrated XML libraries instead.
Internal modification: All references to the JDOM library were removed. Logisim now uses Java's integrated XML support instead.

218
scripts/create-jar.py Normal file
View File

@ -0,0 +1,218 @@
#!/cygdrive/c/Python31/python
import os
import re
import sys
import shutil
import glob
from logisim_script import *
src_dir = get_svn_dir('src')
doc_dir = get_svn_dir('doc')
libs_dir = get_svn_dir('libs')
data_dir = get_svn_dir('scripts/data')
dest_dir = os.getcwd()
jar_exec = 'jar'
javac_exec = 'javac'
# configure defaults
include_source = True
include_documentation = True
bin_dir = None
dest_dir = os.getcwd()
temp_dir = None
keep_temp = False
# see if we're on Carl Burch's platform, and if so reconfigure defaults
if '\\home\\burch\\' in get_svn_dir():
svn_dir = get_svn_dir()
home = svn_dir[:svn_dir.find('\\home\\burch\\') + 11]
bin_dir = build_path(home, 'logisim/TrunkSource/bin')
dest_dir = build_path(home, 'logisim/Scripts')
usage = '''usage: create-jar ARGS
arguments: -bin DIR compiled files are already present in DIR
-d DIR place created JAR file in DIR
-keep keep temporary directory after completion
-nodoc omit documentation from created JAR file
-nosrc omit source code from created JAR file
-temp DIR use DIR as the temporary directory
'''.rstrip()
argi = 0
print_usage = False
while argi + 1 < len(sys.argv):
argi += 1
arg = sys.argv[argi]
if arg == '-bin' and argi + 1 < len(sys.argv):
argi += 1
bin_dir = argv[argi]
elif arg == '-d' and argi + 1 < len(sys.argv):
argi += 1
dest_dir = argv[argi]
elif arg == '-keep':
keep_temp = True
elif arg == '-nodoc':
include_documentation = False
elif arg == '-nosrc':
include_source = False
elif arg == '-temp' and argi + 1 < len(sys.argv):
argi += 1
temp_dir = argv[argi]
else:
print_usage = True
if print_usage:
sys.exit(usage)
if bin_dir is None:
sys.exit('automatic compilation of source code is not yet supported')
if bin_dir is not None and not os.path.exists(bin_dir):
sys.exit('binary directory ' + bin_dir + ' does not exist')
if not os.path.exists(dest_dir):
sys.exit('destination directory ' + dest_dir + ' does not exist')
if temp_dir is not None and not os.path.exists(os.path.dirname(temp_dir)):
sys.exit('temporary directory\'s parent ' + os.path.dirname(temp_dir)
+ ' does not exist')
#
# Determine the version number and copyright year
#
version, copyright = determine_version_info()
if version is None or copyright is None:
sys.exit(-1)
print('version ' + version + ', (c) ' + copyright)
#
# prepare the temporary directory to be completely empty
#
if temp_dir is None:
current = os.listdir(dest_dir)
for i in range(1, 11):
name = 'files' if i is 1 else 'files' + str(i)
if name not in current:
temp_dir = os.path.join(dest_dir, name)
break
if temp_dir is None:
sys.exit('all default temporary directories (files* in ' + dest_dir
+ ') already exist, please clean')
print('using temporary directory ' + temp_dir)
elif os.path.exists(temp_dir):
print('Temporary directory ' + temp_dir + ' already exists.')
user = prompt('Do you want to replace it ([y]es, [n]o)?', 'yn')
if user == 'n':
sys.exit()
shutil.rmtree(temp_dir)
os.mkdir(temp_dir)
# from here to the end, any fatal errors should first delete the temporary
# directory - we set this up so this happens automatically
old_sys_exit = sys.exit
def fatal_error(msg=None):
if not keep_temp:
shutil.rmtree(temp_dir)
if msg is None:
old_sys_exit(-1)
else:
old_sys_exit(msg)
sys.exit = fatal_error
# set things up so dot-files are excluded when copying directories
def copytree(src_dir, dst_dir, ignore=None):
def ignore_hidden(dir, files):
ret = [] if ignore is None else ignore(dir, files)
ret.extend([f for f in files if f.startswith('.') and f not in ret])
return ret
shutil.copytree(src_dir, dst_dir, ignore=ignore_hidden)
#
# copy the binary directory if provided
#
if bin_dir is not None:
print('copying binary files')
copytree(build_path(bin_dir, 'com'), build_path(temp_dir, 'com'))
#
# unpack all the JARs being used
#
print('unpacking JAR libraries')
os.chdir(temp_dir)
for jar_file in os.listdir(libs_dir):
if jar_file.endswith('.jar'):
if jar_file == 'jh.jar' and not include_documentation:
pass # we don't want to include documentation here
else:
system(jar_exec, 'fx', build_path(libs_dir, jar_file))
# don't include directories that will be created anyway for JAR file
for exclude in ['src', 'resources', 'META-INF', 'COPYING.TXT']:
if os.path.exists(build_path(temp_dir, exclude)):
shutil.rmtree(build_path(temp_dir, exclude))
#
# compile the binary directory if it wasn't provided
#
if bin_dir is None:
print('compiling source code')
sys.exit('not yet supported')
#
# create the resources, src, and documentation directories
#
print('copying resources')
copytree(build_path(src_dir, 'resources'), build_path(temp_dir, 'resources'))
if include_source:
print('copying source code')
os.mkdir(build_path(temp_dir, 'src'))
copytree(build_path(src_dir, 'com'), build_path(temp_dir, 'src/com'))
if include_documentation:
print('copying documentation')
copytree(doc_dir, build_path(temp_dir, 'doc'))
jhindexer = build_path(data_dir, 'javahelp/bin/jhindexer.jar')
for locale in os.listdir(doc_dir):
locale_dir = build_path(temp_dir, 'doc', locale)
if os.path.isdir(locale_dir):
print('indexing documentation [' + locale + ']')
os.chdir(locale_dir)
cmd_args = ['java', '-jar', jhindexer]
if os.path.exists('jhindexer.cfg'):
cmd_args.extend(['-c', 'jhindexer.cfg'])
cmd_args.extend(['-locale', locale])
cmd_args.extend(['guide', 'libs'])
system(*cmd_args)
#
# copy in the .class files that were compiled under MacOS
#
print('adding MacOS support')
macos_dir = build_path(data_dir, 'macos-classes')
for macos_file in os.listdir(macos_dir):
macos_dst = build_path(temp_dir, 'com/cburch/logisim/gui/start', macos_file)
shutil.copyfile(build_path(macos_dir, macos_file), macos_dst)
#
# insert GPL, create manifest
#
print('creating JAR file')
# include COPYING.TXT and manifest
shutil.copyfile(build_path(data_dir, 'COPYING.TXT'),
build_path(temp_dir, 'COPYING.TXT'))
os.mkdir(build_path(temp_dir, 'META-INF'))
with open(build_path(temp_dir, 'META-INF/MANIFEST.MF'), 'wb') as manifest:
manifest.write(bytes('Main-Class: com.cburch.logisim.Main\n', 'UTF-8'))
# and now create the JAR
os.chdir(temp_dir)
files_to_include = os.listdir('.')
files_to_include.remove('META-INF')
jar_filename = 'logisim-fragile-' + version + '.jar'
jar_pathname = build_path(dest_dir, jar_filename)
system(jar_exec, 'fcm', jar_pathname, 'META-INF/MANIFEST.MF', *files_to_include)
if not keep_temp:
print('deleting temporary directory')
shutil.rmtree(temp_dir)
size = int(round(os.path.getsize(jar_pathname) / 1024.0))
print('done creating ' + jar_filename + ' (' + str(size) + 'KB)')

340
scripts/data/COPYING.TXT Normal file
View File

@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

View File

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>CFBundleName</key>
<string>Logisim</string>
<key>CFBundleVersion</key>
<string>10.2</string>
<key>CFBundleAllowMixedLocalizations</key>
<string>true</string>
<key>CFBundleExecutable</key>
<string>JavaApplicationStub</string>
<key>CFBundleIconFile</key>
<string>LogisimApp.icns</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.5.0</string>
<key>CFBundleSignature</key>
<string>LGSM</string>
<key>CFBundleGetInfoString</key>
<string>2.5.0. Copyright 2010 Carl Burch. See accompanying license (GPL) for details.</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>Java</key>
<dict>
<key>MainClass</key>
<string>com.cburch.logisim.Main</string>
<key>JVMVersion</key>
<string>1.5+</string>
<key>ClassPath</key>
<array>
<string>$JAVAROOT/logisim.jar</string>
</array>
<key>Properties</key>
<dict>
<key>apple.laf.useScreenMenuBar</key>
<string>true</string>
</dict>
</dict>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array><string>circ</string></array>
<key>CFBundleTypeIconFile</key>
<string>LogisimDoc.icns</string>
<key>CFBundleTypeName</key>
<string>Logisim Project File</string>
<key>CFBundleTypeOSTypes</key>
<string>****</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
</array>
<key>NSHumanReadableCopyright</key>
<string>Copyright 2010 Carl Burch. See accompanying license (GPL) for details.</string>
</dict>
</plist>

View File

@ -0,0 +1 @@
APPLLGSM

View File

@ -0,0 +1,6 @@
The full Logisim distribution is archived in the JAR file at:
Contents/Resources/Java/logisim.jar
from this file's location. That JAR file includes all the compiled
files, the documentation files, and the Logisim source code.

View File

@ -0,0 +1,49 @@
#! /bin/sh
# This builds a search database
# Cygwin support. $cygwin _must_ be set to either true or false.
case "`uname`" in
CYGWIN*) cygwin=true ;;
*) cygwin=false ;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin; then
[ -n "$JAVAHELP_HOME" ] &&
JAVAHELP_HOME=`cygpath --unix "$JAVAHELP_HOME"`
fi
if [ "$JAVAHELP_HOME" = "" ] ; then
# try to find jhindexer
if [ -d /opt/javahelp ] ; then
JAVAHELP_HOME=/opt/javahelp
fi
if [ -d ${HOME}/opt/jhindexer ] ; then
JAVAHELP_HOME=${HOME}/opt/javahelp
fi
## resolve links - $0 may be a link to javahelp's home
PRG=$0
progname=`basename $0`
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '.*/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname $PRG`/$link"
fi
done
JAVAHELP_HOME=`dirname "$PRG"`/../..
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
JAVAHELP_HOME=`cygpath --path --windows "$JAVAHELP_HOME"`
fi
java -jar $JAVAHELP_HOME/javahelp/bin/jhindexer.jar "$@"

View File

@ -0,0 +1,75 @@
@echo off
REM
REM @(#)jhindexer.bat 1.20 06/10/30
REM
REM Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
REM
REM This code is free software; you can redistribute it and/or modify it
REM under the terms of the GNU General Public License version 2 only, as
REM published by the Free Software Foundation. Sun designates this
REM particular file as subject to the "Classpath" exception as provided
REM by Sun in the LICENSE file that accompanied this code.
REM
REM This code is distributed in the hope that it will be useful, but WITHOUT
REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
REM version 2 for more details (a copy is included in the LICENSE file that
REM accompanied this code).
REM
REM You should have received a copy of the GNU General Public License version
REM 2 along with this work; if not, write to the Free Software Foundation,
REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
REM
REM Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
REM CA 95054 USA or visit www.sun.com if you need additional information or
REM have any questions.
REM
if not "%OS%"=="Windows_NT" goto win9xStart
:winNTStart
@setlocal
rem %~dp0 is name of current script under NT
set DEFAULT_JAVAHELP_HOME=%~dp0
rem : operator works similar to make : operator
set DEFAULT_JAVAHELP_HOME=%DEFAULT_JAVAHELP_HOME:\javahelp\bin\=%
if %JAVAHELP_HOME%a==a set JAVAHELP_HOME=%DEFAULT_JAVAHELP_HOME%
set DEFAULT_JAVAHELP_HOME=
goto doneStart
:win9xStart
:doneStart
rem This label provides a place for NT handling to skip to.
rem find JAVAHELP_HOME
if not "%JAVAHELP_HOME%"=="" goto runjhindexer
rem check for JavaHelp in Program Files on system drive
if not exist "%SystemDrive%\Program Files\jh" goto checkSystemDrive
set JAVAHELP_HOME=%SystemDrive%\Program Files\jh
goto checkJava
:checkSystemDrive
rem check for JavaHelp in root directory of system drive
if not exist "%SystemDrive%\jh" goto noJavaHelpHome
set JAVA_HOME=%SystemDrive%\jh
goto runjhindexer
:noJavaHelpHome
echo JAVAHELP_HOME is not set and JavaHelp could not be located. Please set JAVAHELP_HOME.
goto end
:runjhindexer
java -jar %JAVAHELP_HOME%\javahelp\bin\jhindexer.jar %1 %2 %3 %4 %5 %6 %7 %8 %9
if not "%OS%"=="Windows_NT" goto mainEnd
:winNTend
@endlocal
:mainEnd

Binary file not shown.

View File

@ -0,0 +1,49 @@
#! /bin/sh
# This searches a search database. Argument is the database directory
# Cygwin support. $cygwin _must_ be set to either true or false.
case "`uname`" in
CYGWIN*) cygwin=true ;;
*) cygwin=false ;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin; then
[ -n "$JAVAHELP_HOME" ] &&
JAVAHELP_HOME=`cygpath --unix "$JAVAHELP_HOME"`
fi
if [ "$JAVAHELP_HOME" = "" ] ; then
# try to find jhindexer
if [ -d /opt/javahelp ] ; then
JAVAHELP_HOME=/opt/javahelp
fi
if [ -d ${HOME}/opt/jhindexer ] ; then
JAVAHELP_HOME=${HOME}/opt/javahelp
fi
## resolve links - $0 may be a link to javahelp's home
PRG=$0
progname=`basename $0`
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '.*/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname $PRG`/$link"
fi
done
JAVAHELP_HOME=`dirname "$PRG"`/../..
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
JAVAHELP_HOME=`cygpath --path --windows "$JAVAHELP_HOME"`
fi
java -jar $JAVAHELP_HOME/javahelp/bin/jhsearch.jar "$@"

View File

@ -0,0 +1,77 @@
@echo off
REM
REM @(#)jhsearch.bat 1.13 06/10/30
REM
REM Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
REM
REM This code is free software; you can redistribute it and/or modify it
REM under the terms of the GNU General Public License version 2 only, as
REM published by the Free Software Foundation. Sun designates this
REM particular file as subject to the "Classpath" exception as provided
REM by Sun in the LICENSE file that accompanied this code.
REM
REM This code is distributed in the hope that it will be useful, but WITHOUT
REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
REM version 2 for more details (a copy is included in the LICENSE file that
REM accompanied this code).
REM
REM You should have received a copy of the GNU General Public License version
REM 2 along with this work; if not, write to the Free Software Foundation,
REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
REM
REM Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
REM CA 95054 USA or visit www.sun.com if you need additional information or
REM have any questions.
REM
if not "%OS%"=="Windows_NT" goto win9xStart
:winNTStart
@setlocal
rem %~dp0 is name of current script under NT
set DEFAULT_JAVAHELP_HOME=%~dp0
rem : operator works similar to make : operator
set DEFAULT_JAVAHELP_HOME=%DEFAULT_JAVAHELP_HOME:\javahelp\bin\=%
if %JAVAHELP_HOME%a==a set JAVAHELP_HOME=%DEFAULT_JAVAHELP_HOME%
set DEFAULT_JAVAHELP_HOME=
goto doneStart
:win9xStart
:doneStart
rem This label provides a place for NT handling to skip to.
rem find JAVAHELP_HOME
if not "%JAVAHELP_HOME%"=="" goto runjhsearch
rem check for JavaHelp in Program Files on system drive
if not exist "%SystemDrive%\Program Files\jh" goto checkSystemDrive
set JAVAHELP_HOME=%SystemDrive%\Program Files\jh
goto checkJava
:checkSystemDrive
rem check for JavaHelp in root directory of system drive
if not exist "%SystemDrive%\jh" goto noJavaHelpHome
set JAVA_HOME=%SystemDrive%\jh
goto runjhsearch
:noJavaHelpHome
echo JAVAHELP_HOME is not set and JavaHelp could not be located. Please set JAVAHELP_HOME.
goto end
:runjhsearch
java -jar %JAVAHELP_HOME%\javahelp\bin\jhsearch.jar %1
if not "%OS%"=="Windows_NT" goto mainEnd
:winNTend
@endlocal
:mainEnd

Binary file not shown.

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
This is the DTD for favorites
Copyright (c) 2001 Sun Microsystems
@(#)favorites_2_0.dtd 1.2 03/19/02
-->
<!-- It is versioned -->
<!ELEMENT favorites (favoriteitem)*>
<!ATTLIST favorites
version CDATA #FIXED "2.0"
xml:lang CDATA #IMPLIED
>
<!-- an item -->
<!ELEMENT favoriteitem (#PCDATA |favoriteitem)*>
<!ATTLIST favoriteitem
xml:lang CDATA #IMPLIED
hstitle CDATA #IMPLIED
url CDATA #IMPLIED
target CDATA #IMPLIED
text CDATA #IMPLIED
>
<!--
Change list:
Created - Richard Gregor, 28 August '01
-->

View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
This is the DTD for helpset
Copyright (c) 1998,1999 Sun Microsystems
@(#)helpset_2_0.dtd 1.5 06/05/03
-->
<!-- A HelpSet. It is versioned -->
<!ELEMENT helpset (title, maps, view+, subhelpset*, presentation*, impl?)>
<!ATTLIST helpset version ( 1.0 | 2.0) #IMPLIED>
<!ATTLIST helpset xml:lang CDATA #IMPLIED>
<!-- The title. -->
<!ELEMENT title (#PCDATA)>
<!-- Maps between ids and urls for this helpset -->
<!-- there is a bug in JH1.0 that forces a single map -->
<!ELEMENT maps (homeID, mapref+)>
<!ELEMENT homeID (#PCDATA)>
<!ELEMENT mapref EMPTY>
<!ATTLIST mapref location CDATA #REQUIRED>
<!-- Views into the information -->
<!ELEMENT view (name | label | image? | type | data?)*>
<!ATTLIST view xml:lang CDATA #IMPLIED>
<!ATTLIST view mergetype CDATA #IMPLIED>
<!ELEMENT name (#PCDATA)>
<!ELEMENT label (#PCDATA)>
<!ELEMENT image (#PCDATA)>
<!ELEMENT type (#PCDATA)>
<!ELEMENT data (#PCDATA)>
<!ATTLIST data engine CDATA #IMPLIED>
<!-- Subhelpsets to merge "statically" -->
<!ELEMENT subhelpset EMPTY>
<!ATTLIST subhelpset location CDATA #IMPLIED>
<!-- Presentation of the HelpSet -->
<!ELEMENT presentation (name, size?, location?, title?, image?, toolbar?)*>
<!ATTLIST presentation xml:lang CDATA #IMPLIED>
<!ATTLIST presentation default (true | false) #IMPLIED>
<!ATTLIST presentation displayviews (true | false) #IMPLIED>
<!ATTLIST presentation displayviewimages (true | false) #IMPLIED>
<!ELEMENT size EMPTY>
<!ATTLIST size width CDATA #REQUIRED>
<!ATTLIST size height CDATA #REQUIRED>
<!ELEMENT location EMPTY>
<!ATTLIST location x CDATA #REQUIRED>
<!ATTLIST location y CDATA #REQUIRED>
<!ELEMENT toolbar (helpaction*)>
<!ELEMENT helpaction (#PCDATA)>
<!ATTLIST helpaction image CDATA #IMPLIED>
<!-- Implementation specific data -->
<!ELEMENT impl (helpsetregistry?, viewerregistry*)>
<!ELEMENT helpsetregistry EMPTY>
<!ATTLIST helpsetregistry helpbrokerclass CDATA #REQUIRED>
<!ELEMENT viewerregistry EMPTY>
<!ATTLIST viewerregistry viewertype CDATA #REQUIRED>
<!ATTLIST viewerregistry viewerclass CDATA #REQUIRED>
<!--
Change list:
Cleanup to be more XML-ish - epll, 15 Dec '98
xml:lang attributes for title, label, and name are no more.
engine is now an attribute of data.
impl is no more; use PI's instead.
data inside map is now the map tag.
More cleanup - epll, 16 Dec '98
moved homeID into map
made data inside map be mapref (for map reference)
Added mergetype attribute into view - rgregor 6 June '01
Added versions
Added presentation
Added impl
-->

View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
This is the DTD for Index
Copyright (c) 1998 Sun Microsystems
@(#)index_2_0.dtd 1.4 06/05/03
-->
<!-- An Index. It is versioned -->
<!ELEMENT index (indexitem*)>
<!ATTLIST index version (1.0 | 2.0) #IMPLIED>
<!ATTLIST index xml:lang CDATA #IMPLIED>
<!-- an item -->
<!ELEMENT indexitem (#PCDATA | indexitem)*>
<!ATTLIST indexitem xml:lang CDATA #IMPLIED>
<!ATTLIST indexitem text CDATA #IMPLIED>
<!ATTLIST indexitem target CDATA #IMPLIED>
<!ATTLIST indexitem mergetype CDATA #IMPLIED>
<!ATTLIST indexitem expand (true | false ) #IMPLIED>
<!ATTLIST indexitem presentationtype CDATA #IMPLIED>
<!ATTLIST indexitem presentationname CDATA #IMPLIED>
<!--
Change list:
Created - epll, 16 Dec '98
Added mergetype attribute into indexitem -rgregor 6 June '01
-->

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
This is the DTD for (flat) Maps
Copyright (c) 1998 Sun Microsystems
@(#)map_2_0.dtd 1.1 03/19/02
-->
<!-- A Map. It is versioned -->
<!ELEMENT map (mapID*)>
<!ATTLIST map version (1.0 | 2.0) #IMPLIED>
<!ATTLIST map xml:lang CDATA #IMPLIED>
<!-- an map ID pair -->
<!ELEMENT mapID EMPTY>
<!ATTLIST mapID xml:lang CDATA #IMPLIED>
<!ATTLIST mapID target CDATA #REQUIRED>
<!ATTLIST mapID url CDATA #REQUIRED>
<!--
Change list:
Created - epll, 16 Dec '98
Added the version 2.0 update
-->

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
This is the DTD for TOC
Copyright (c) 1998 Sun Microsystems
@(#)toc_2_0.dtd 1.4 06/05/03
-->
<!-- A TOC. It is versioned -->
<!ELEMENT toc (tocitem*)>
<!ATTLIST toc version ( 1.0 | 2.0) #IMPLIED>
<!ATTLIST toc xml:lang CDATA #IMPLIED>
<!ATTLIST toc categoryopenimage CDATA #IMPLIED>
<!ATTLIST toc categoryclosedimage CDATA #IMPLIED>
<!ATTLIST toc topicimage CDATA #IMPLIED>
<!-- an item -->
<!ELEMENT tocitem (tocitem)*>
<!ATTLIST tocitem xml:lang CDATA #IMPLIED>
<!ATTLIST tocitem text CDATA #REQUIRED>
<!ATTLIST tocitem image CDATA #IMPLIED>
<!ATTLIST tocitem target CDATA #IMPLIED>
<!ATTLIST tocitem mergetype CDATA #IMPLIED>
<!ATTLIST tocitem expand (true | false ) #IMPLIED>
<!ATTLIST tocitem presentationtype CDATA #IMPLIED>
<!ATTLIST tocitem presentationname CDATA #IMPLIED>
<!--
Change list:
Created - epll, 16 Dec '98
Added mergetype attribute into tocitem -rgregor 6 June '01
-->

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,12 +1,17 @@
import os.path
import re
import sys
def get_svn_dir(*subdirs):
script_dir = sys.path[0]
cur_dir = os.path.dirname(script_dir)
def build_path(first, *subdirs):
dir = first
for subdir in subdirs:
cur_dir = os.path.join(cur_dir, subdir)
return cur_dir
for subsub in subdir.split('/'):
dir = os.path.join(dir, subsub)
return dir
def get_svn_dir(*subdirs):
script_parent = os.path.dirname(sys.path[0])
return build_path(script_parent, *subdirs)
def is_same_file(a, b):
samefile = getattr(os.path, 'samefile', None)
@ -15,4 +20,50 @@ def is_same_file(a, b):
b_norm = os.path.normcase(os.path.abspath(b))
return a_norm == b_norm
else:
return samefile(a, b)
return samefile(a, b)
def system(*args):
os.system(' '.join(args))
def prompt(prompt, accept=None):
while True:
ret = input(prompt + ' ')
ret = ret.rstrip()
if accept is None or ret in accept:
return ret
def determine_version_info():
version = None
version_line = -1
copyright = None
copyright_line = -1
main_name = get_svn_dir('src/com/cburch/logisim/Main.java')
with open(main_name) as main_file:
version_re = re.compile(r'.*VERSION = LogisimVersion.get\(([0-9, ]*)\)')
year_re = re.compile(r'COPYRIGHT_YEAR = ([0-9]+)')
line_num = -1
for line in main_file:
line_num += 1
mat = version_re.search(line)
if mat:
if version_line < 0:
version = re.sub(r'\s*,\s*', '.', mat.group(1))
version_line = line_num
else:
sys.stderr.write('duplicate version on line '
+ str(version_line) + ' and ' + str(line_num) + '\n')
version = None
mat = year_re.search(line)
if mat:
if copyright_line < 0:
copyright = mat.group(1)
copyright_line = line_num
else:
sys.stderr.write('duplicate copyright year on line '
+ str(copyright_line) + ' and ' + str(line_num) + '\n')
copyright = None
if version_line < 0:
sys.stderr.write('version number not found\n')
if copyright_line < 0:
sys.stderr.write('copyright year not found\n')
return version, copyright

View File

@ -24,7 +24,7 @@ package com.cburch.logisim;
import com.cburch.logisim.gui.start.Startup;
public class Main {
public static final LogisimVersion VERSION = LogisimVersion.get(2, 5, 1, 45);
public static final LogisimVersion VERSION = LogisimVersion.get(2, 5, 1);
public static final String VERSION_NAME = VERSION.toString();
public static final int COPYRIGHT_YEAR = 2010;