[Pkg-mozext-commits] [itsalltext] 416/459: New build structure

David Prévot taffit at moszumanska.debian.org
Tue Feb 24 23:26:44 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository itsalltext.

commit 2fb0283619b361cf17b35541c2c5600cd603b5b8
Author: Christian Höltje <docwhat at gerf.org>
Date:   Tue May 14 00:55:47 2013 -0400

    New build structure
    
    * Uses `rake` instead of `make`
    * Cleaned up install.rdf
    * Don't create sub-jars.
---
 .gitignore      |   1 +
 Gemfile         |   4 ++
 Gemfile.lock    |  12 ++++
 Makefile        | 182 --------------------------------------------------------
 Rakefile        |  63 ++++++++++++++++++++
 src/install.rdf |  65 ++++++++++----------
 6 files changed, 114 insertions(+), 213 deletions(-)

diff --git a/.gitignore b/.gitignore
index 4148f53..6a052c0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@ final/*
 *.xpi
 .*-stamp
 .todo
+/.bundle
diff --git a/Gemfile b/Gemfile
new file mode 100644
index 0000000..67b7f4b
--- /dev/null
+++ b/Gemfile
@@ -0,0 +1,4 @@
+source "https://rubygems.org"
+
+gem 'rake', '~> 10.0'
+gem 'paint', '~> 0.8', '>= 0.8.6'
diff --git a/Gemfile.lock b/Gemfile.lock
new file mode 100644
index 0000000..c4fe0ef
--- /dev/null
+++ b/Gemfile.lock
@@ -0,0 +1,12 @@
+GEM
+  remote: https://rubygems.org/
+  specs:
+    paint (0.8.6)
+    rake (10.0.4)
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  paint (~> 0.8, >= 0.8.6)
+  rake (~> 10.0)
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 52193c2..0000000
--- a/Makefile
+++ /dev/null
@@ -1,182 +0,0 @@
-#
-#
-#  It's All Text - Easy external editing of web forms.
-#  Copyright (C) 2006-2007 Christian Höltje
-#
-#  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 3 of the License.
-#
-#  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, see <http://www.gnu.org/licenses/>.
-
-## Options
-# If you don't have jslint or jsmin, you can replace these with cat...
-# but I strongly suggest you get jslint and jsmin working.
-YC         := yuicompressor
-YC_JSFLAGS := --type js --charset UTF-8
-ZIP        := zip
-PROJNICK   := itsalltext
-PROJNAME   := "It's All Text!"
-ICONFILE   := src/chrome/content/icon.png
-VERSION    := 1.7.0
-
-
-# NOTE: do not create files or directories in here that have
-#       spaces or other special characters in their names!
-SOURCES_CHROME:=$(shell find src/chrome -type f\
-	   -not -regex '^\(\|.*/\)\(build\|lint\|tmpdir\|.svn\|CVS\|.DS_Store\).*\(\|/.*\)$$' \
-       -not -regex '.*\.(xpi|orig|lint|log|xcf)' \
-       -not -name '.*' \
-       -not -name '*~' \
-       -not -name '\#*' \
-	   -print)
-SOURCES_NONCHROME:=src/chrome.manifest src/gpl.txt src/install.rdf src/defaults/preferences/itsalltext.js
-SOURCES:=$(SOURCES_CHROME) $(SOURCES_NONCHROME)
-SOURCES_JS:=$(shell echo "$(SOURCES)" | xargs -n 1 echo | grep -E '\.js$$')
-JARS:=chrome/content.jar $(patsubst src/chrome/locale/%, chrome/%.jar, $(wildcard src/chrome/locale/*-*))
-
-STAGE1_OUT:=$(patsubst src/%, stage1/%, $(SOURCES))
-FINAL_OUT:=$(patsubst src/%, final/%, $(SOURCES_NONCHROME)) \
-	       $(patsubst %, final/%, $(JARS))
-
-XPI_FILE:=$(PROJNICK)-$(VERSION).xpi
-
-ifeq ($(VERBOSE),1)
-	Q :=
-	QMAKE = $(MAKE)
-else
-	Q := @
-	QMAKE = $(MAKE) -s
-	ZIP := $(ZIP) -q
-endif
-
-.PHONY: default
-default: narf final
-
-.PHONY: all
-all: narf docs final
-
-## Release a new xpi
-.PHONY: release
-release: version_check $(XPI_FILE)
-	$(Q)echo "Don't forget to bump the version number if $(VERSION) isn't right!"
-	$(Q)echo "git tag release-$(VERSION) ; git push --tags"
-
-## Show the version
-.PHONY: version_check
-version_check:
-	$(Q)echo "Version is $(VERSION)"
-
-## build an xpi
-%.xpi: build
-	$(Q)echo Creating $@ ...
-	$(Q)(cd final && find -type f | $(ZIP) ../$@ -@)
-
-
-#############
-## Stage 1 ##
-#############
-.PHONY: stage1
-stage1: .stage1-stamp
-
-.stage1-stamp: Makefile $(STAGE1_OUT)
-	$(Q)touch $@
-
-stage1/%: src/%
-	$(Q)mkdir -p $(dir $@)
-	$(Q)cat $< | sed 's/999.@@VERSION@@/$(VERSION)/g' > $@
-
-stage1/%.js: src/%.js
-	$(Q)mkdir -p $(dir $@)
-	$(Q)$(YC) $(YC_JSFLAGS) -o $@ $<
-
-
-#################
-## Final Stage ##
-#################
-.PHONY: final
-final: .final-stamp
-
-.final-stamp: Makefile $(FINAL_OUT)
-	$(Q)touch $@
-
-final/%: stage1/%
-	$(Q)mkdir -p $(dir $@)
-	$(Q)cp $< $@
-
-final/chrome.manifest: stage1/chrome.manifest Makefile
-	$(Q)mkdir -p $(dir $@)
-	$(Q)perl -p -e 's!^(\s*content\s+itsalltext\s+)(chrome/)(\S+\s*.*)$$!$$1jar:$$2content.jar\!/$$3!;'  \
-	-e 's!^(\s*locale\s+itsalltext\s+)(\S+)(\s+)(chrome/)locale/(\S+\s*)$$!$$1$$2$$3jar:$$4$$2.jar\!/$$5!;' $< \
-	> $@
-
-final/chrome/content.jar: stage1 Makefile
-	$(Q)mkdir -p $(dir $@)
-	$(Q)cd stage1/chrome && $(ZIP) -r ../../$@ content
-
-final/chrome/%.jar: stage1 Makefile
-	$(Q)mkdir -p $(dir $@)
-	$(Q)cd stage1/chrome/locale && $(ZIP) -r ../../../$@ $(patsubst final/chrome/%.jar, %, $@)
-
-.PHONY: build
-build: final
-
-##
-## Narf is a magick keyword that should stop builds from working
-## Useful as a todo marker.
-.PHONY: narf
-narf: .narf-stamp
-
-.narf-stamp:
-	$(Q)grep -nri 'narf' [a-z0-9]* ; test $$? = 1 || :
-	$(Q)touch $@
-
-##
-## Documentation
-.PHONY: docs
-docs: docs/.stamp
-
-docs/.stamp: $(SOURCES_JS)
-	$(Q)echo Creating docs ...
-	$(Q)jsdoc --directory docs \
-	--project-name "$(subst ", ', PROJNAME) - A Firefox Extension" \
-	--logo $(ICONFILE) \
-	--package-naming \
-	--private \
-	$^
-	$(Q)touch "$@"
-
-.PHONY: todo
-todo: .todo
-	$(Q)cat $<
-.todo: $(SOURCES) Makefile notes.txt
-	$(Q)grep -hE '[@]todo' $^ | perl -p -e 's!^.*[@]todo\s*!!' | sort -n > "$@"
-
-
-##
-## Cleanup methods
-.PHONY: clean
-clean:
-	$(Q)rm -rf build .todo stage1 final .*-stamp
-	$(Q)find -name '*.orig' -print0 | xargs -0 -r rm
-
-.PHONY: realclean
-realclean: clean
-	$(Q)rm -rf $(XPI_FILE) docs lint
-
-## @todo [5] [make] Do a proper build in another directory.
-## @todo [5] [make] Minimize JavaScript.
-## @todo [5] [make] Put contents into a .jar.
-## @todo [7] Allow a web page to add an It's All Text! button.
-## @todo [9] Thunderbird support.
-## @todo [8] Seamonkey support. GUID: {92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
-## @todo [9] Option to disable yellow fade.
-## @todo [9] Prevent double yellow fades.
-## @todo [9] Option to choose yellow fade color.
-## @todo [9] Option to turn off button fade.
diff --git a/Rakefile b/Rakefile
new file mode 100644
index 0000000..788872a
--- /dev/null
+++ b/Rakefile
@@ -0,0 +1,63 @@
+require 'paint'
+
+VERSION="1.8.0"
+XPI_FILENAME = "itsalltext-#{VERSION}.xpi"
+
+FIREFOX_SOURCE_EXTENSIONS = [
+  'dtd',
+  'js',
+  'manifest',
+  'png',
+  'properties',
+  'rdf',
+  'txt',
+  'xul',
+]
+FIREFOX_SOURCES = FIREFOX_SOURCE_EXTENSIONS.map { |x| Dir["src/**/*.#{x}"] }.flatten.freeze
+
+task :default => :build
+
+desc "Build add-on #{VERSION}"
+task :build => [XPI_FILENAME]
+
+# Alias, because I forget.
+task :release => [:build]
+
+desc "Install It's All Text! into firefox"
+task :install => :build do
+  sh 'open', '-a', 'Firefox', XPI_FILENAME
+end
+
+desc "Clean up temporary files"
+task :clean do
+  rm_rf 'final'
+end
+
+file "final" => FIREFOX_SOURCES do |t|
+  rm_rf 'final'
+  t.prerequisites.each do |src|
+    dst = src.sub(%r{\Asrc/}, 'final/')
+    dst_parent = File.dirname(dst)
+    mkdir_p dst_parent unless File.directory?(dst_parent)
+    if src.end_with?('.js') || src.end_with?('.rdf')
+      puts "versioning #{src} #{dst}"
+      File.open(dst, 'w') do |f|
+        f.write File.read(src).gsub(%r{999\.@@VERSION@@}, VERSION)
+      end
+    else
+      cp src, dst
+    end
+  end
+end
+
+file XPI_FILENAME => ["final"] do |t|
+  rm_f t.name
+  xpi_path = File.expand_path(t.name)
+  Dir.chdir "final" do
+    sh "zip", "-q", xpi_path, *Dir['**/*']
+  end
+
+  puts
+  puts Paint["Don't forget to bump the version number if #{VERSION} isn't correct!", :cyan]
+  puts Paint["git tag release-#{VERSION} ; git push --tags", :cyan]
+end
diff --git a/src/install.rdf b/src/install.rdf
index aead612..0ff090f 100644
--- a/src/install.rdf
+++ b/src/install.rdf
@@ -1,34 +1,37 @@
-<?xml version="1.0"?>
-<RDF:RDF xmlns:em="http://www.mozilla.org/2004/em-rdf#"
-         xmlns:NC="http://home.netscape.com/NC-rdf#"
-         xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+<?xml version="1.0" encoding="UTF-8"?>
+<RDF
+  xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+  xmlns:em="http://www.mozilla.org/2004/em-rdf#">
 
-  <!-- Firefox -->
-  <RDF:Description RDF:about="rdf:#$firefox"
-                   em:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
-                   em:minVersion="16.0"
-                   em:maxVersion="24" />
+  <Description about="urn:mozilla:install-manifest">
+    <em:id>itsalltext at docwhat.gerf.org</em:id>
+    <em:version>999.@@VERSION@@</em:version>
+    <em:type>2</em:type>
 
-  <!-- SeaMonkey -->
-  <RDF:Description RDF:about="rdf:#$seamonkey"
-      em:id="{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}"
-      em:minVersion="2.0"
-      em:maxVersion="2.21" />
+    <!-- Firefox -->
+    <em:targetApplication>
+      <Description>
+        <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
+        <em:minVersion>16.0</em:minVersion>
+        <em:maxVersion>24.0</em:maxVersion>
+      </Description>
+    </em:targetApplication>
 
-  <!-- My Extension -->
-  <RDF:Description RDF:about="urn:mozilla:install-manifest"
-                   em:id="itsalltext at docwhat.gerf.org"
-                   em:version="999.@@VERSION@@"
-                   em:type="2"
-                   em:name="It's All Text!"
-                   em:description="Edit text using your favorite editor!"
-                   em:homepageURL="http://addons.mozilla.org/firefox/4125"
-                   em:optionsURL="chrome://itsalltext/content/preferences.xul"
-                   em:iconURL="chrome://itsalltext/content/icon.png"
-                   em:aboutURL="chrome://itsalltext/content/about.xul"
-                   em:creator="Christian Höltje">
-    <em:targetApplication RDF:resource="rdf:#$firefox"/>
-    <em:targetApplication RDF:resource="rdf:#$seamonkey"/>
-    <em:unpack>true</em:unpack>
-  </RDF:Description>
-</RDF:RDF>
+    <!-- Seamonkey -->
+    <em:targetApplication>
+      <Description>
+        <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
+        <em:minVersion>2.12</em:minVersion>
+        <em:maxVersion>2.21</em:maxVersion>
+      </Description>
+    </em:targetApplication>
+
+    <em:name>It's All Text!</em:name>
+    <em:description>Edit text using your favorite editor!</em:description>
+    <em:homepageURL>http://addons.mozilla.org/firefox/4125</em:homepageURL>
+    <em:optionsURL>chrome://itsalltext/content/preferences.xul</em:optionsURL>
+    <em:iconURL>chrome://itsalltext/content/icon.png</em:iconURL>
+    <em:aboutURL>chrome://itsalltext/content/about.xul</em:aboutURL>
+    <em:creator>Christian Höltje</em:creator>
+  </Description>
+</RDF>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/itsalltext.git



More information about the Pkg-mozext-commits mailing list