diff --git a/copyright.txt b/LICENSE-Alliance-For-Sustainable-Energy-Before-Before-8-2020.md similarity index 99% rename from copyright.txt rename to LICENSE-Alliance-For-Sustainable-Energy-Before-Before-8-2020.md index 664b7ed..96cd7c3 100644 --- a/copyright.txt +++ b/LICENSE-Alliance-For-Sustainable-Energy-Before-Before-8-2020.md @@ -24,4 +24,3 @@ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/LICENSE.md b/LICENSE.md index 96cd7c3..bb493b2 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC, and other contributors. All rights reserved. +OpenStudio(R), Copyright (c) 2008-2020, OpenStudio Coalition and other contributors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/developer/ApplyCopyright.rb b/developer/ApplyCopyright.rb new file mode 100644 index 0000000..e653a89 --- /dev/null +++ b/developer/ApplyCopyright.rb @@ -0,0 +1,142 @@ +# Inserts copyright at beginning of each +# +# Inputs: +# ARGV[0] - path to top level cmake source directory (one level above 'src' directory) + +require 'pathname' +require 'rubygems' +require 'fileutils' + +include FileUtils + +# check that called from command line directly +if not ($0 == __FILE__) + puts "#{__FILE__} called from external script" + exit +end + +basepath = ARGV[0].gsub("\\", "/") + +copyright = "/***********************************************************************************************************************\n" +ruby_copyright = "########################################################################################################################\n" +File.open(basepath + "/LICENSE.md") do |file| + while (line = file.gets) + if line.strip.empty? + copyright += "*" + line + ruby_copyright += "#" + line + + else + copyright += "* " + line + ruby_copyright += "# " + line + end + end +end +copyright += "***********************************************************************************************************************/\n\n" +ruby_copyright += "########################################################################################################################\n\n" + +# first do c++ + +# exceptions are files that are not part of OpenStudio +exceptions = [basepath + "/src/qtwinmigrate/", + "mainpage.hpp"] + +# glob for hpp and cpp +files = Dir.glob(basepath + "/src/**/*.[ch]pp") +files.concat Dir.glob(basepath + "/ruby/**/*.[ch]pp") +files.concat Dir.glob(basepath + "/src/**/*.cxx.in") +files.concat Dir.glob(basepath + "/src/**/*.tmp") + +# reject exceptions +files.reject! do |p| + result = false + exceptions.each do |e| + if p.include?(e) + result = true + puts p + break + end + end + result +end + +# loop over all files +files.each do |p| + + # start with copyright + text = copyright + + # read file + File.open(p, "r") do |file| + # read until end of current copyright + while (line = file.gets) + if not /^\s?[\/\*]/.match(line) + if not line.chomp.empty? + text += line + end + break + end + end + + # now keep rest of file + while (line = file.gets) + text += line + end + end + + # write file + File.open(p, "w") do |file| + file << text + end + +end + +# now do ruby + +# exceptions are files that are not part of OpenStudio +exceptions = [] + +# glob for rb +files = Dir.glob(basepath + "/ruby/**/*.rb") + +# reject exceptions +files.reject! do |p| + result = false + exceptions.each do |e| + if p.include?(e) + result = true + break + end + end + result +end + +# loop over all files +files.each do |p| + + # start with copyright + text = ruby_copyright + + # read file + File.open(p, "r") do |file| + # read until end of current copyright + while (line = file.gets) + if not /^#/.match(line) + if not line.chomp.empty? + text += line + end + break + end + end + + # now keep rest of file + while (line = file.gets) + text += line + end + end + + # write file + File.open(p, "w") do |file| + file << text + end + +end diff --git a/plugin/openstudio/lib/dialogs/html/About.html b/plugin/openstudio/lib/dialogs/html/About.html index c74250d..017cfed 100644 --- a/plugin/openstudio/lib/dialogs/html/About.html +++ b/plugin/openstudio/lib/dialogs/html/About.html @@ -29,10 +29,7 @@ OpenStudio Version:

https://openstudio.net/

-Developed by the National Renewable Energy Laboratory
-For the United States Department of Energy

- -Copyright © 2008-2020, Alliance for Sustainable Energy, LLC, and other contributors

+Copyright © 2020-2020, OpenStudio Coalition and other contributors