diff --git a/.github/workflows/closure.yml b/.github/workflows/closure.yml deleted file mode 100644 index 0caa8eb0f..000000000 --- a/.github/workflows/closure.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Stage Google closure library - -on: [workflow_dispatch] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Check out - uses: actions/checkout@v3 - - name: Set Github identity - run: | - git config --global user.name clojure-build - git config --global user.email "clojure-build@users.noreply.github.com" - - name: Set up Java - uses: actions/setup-java@v3 - with: - java-version: 8 - distribution: 'temurin' - server-id: sonatype-nexus-staging - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD - gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} - gpg-passphrase: GPG_PASSPHRASE - - name: Release - run: | - cd script/closure-library-release - ./closure-library-release.sh - env: - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} - GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} - HUDSON: true diff --git a/script/closure-library-release/.gitignore b/script/closure-library-release/.gitignore deleted file mode 100644 index 4a225889a..000000000 --- a/script/closure-library-release/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -closure-library/ -tmp-build/ diff --git a/script/closure-library-release/closure-library-release.sh b/script/closure-library-release/closure-library-release.sh deleted file mode 100755 index e5cdb29f0..000000000 --- a/script/closure-library-release/closure-library-release.sh +++ /dev/null @@ -1,200 +0,0 @@ -#!/usr/bin/env bash - -# closure-library-release.sh - -# ClojureScript depends on the Google Closure JavaScript Libraries, -# but Google does not publish those libraries in a Maven repository. -# This script builds generates Maven projects for the Google Closure -# Library and, optionally, deploys them. - -# The Google Closure Libraries are divided into two parts: the main -# library and third-party extensions. The main library is Apache -# licensed; the third-party extensions have a variety of different -# licenses. However, code in the main library depends on the -# third-party extensions, not the other way around. See CLJS-418 for -# details. - -# To manage this, we build two JARs, google-closure-library and -# google-closure-library-third-party, with the former declaring an -# explicit dependency on the latter. This permits consumers to exclude -# the third-party libraries (and their various licenses) if they know -# they don't need them. - -# To match this structure, we need to alter the deps.js file that the -# Google Closure Compiler uses to resolve dependencies. See CLJS-276 -# for details. - -# The last release ZIP made by Google was 20130212-95c19e7f0f5f. To -# get newer versions, we have to go to the Git repository. - - -set -e - -### Constants - -POM_TEMPLATE_FILE="google-closure-library.pom.template" -THIRD_PARTY_POM_TEMPLATE_FILE="google-closure-library-third-party.pom.template" -GIT_CLONE_URL="https://github.com/google/closure-library.git" - -### Functions - -function print_usage { - echo "Usage: ./make-closure-library-jars.sh - - is the root directory of the Google Closure library -Git repository." -} - -### MAIN SCRIPT BEGINS HERE - -## Command-line validation - -if [[ ! -e $POM_TEMPLATE_FILE || ! -e $THIRD_PARTY_POM_TEMPLATE_FILE ]]; then - echo "This script must be run from the directory containing -google-closure-library.pom.template and -google-closure-library-third-party.pom.template" - exit 1 -fi - -## Fetch the Git repo - -closure_library_dir="closure-library" - -if [[ ! -d $closure_library_dir ]]; then - git clone "$GIT_CLONE_URL" "$closure_library_dir" -fi - -( - cd "$closure_library_dir" - git clean -fdx - git checkout master - git pull -) - -closure_library_base="$closure_library_dir/closure" -third_party_base="$closure_library_dir/third_party/closure" - -if [[ ! -d $closure_library_base || ! -d $third_party_base ]]; then - echo "$closure_library_dir does not look like the Closure library" - exit 1 -fi - -## Working directory - -now=$(date "+%Y%m%d%H%M%S") -work_dir="tmp-build" - -echo "Working directory: $work_dir" - -rm -rf "$work_dir" -mkdir "$work_dir" - -## Git parsing for release version - -commit_details=$(cd "$closure_library_dir"; git log -n 1 '--pretty=format:%H %ci') - -commit_short_sha=${commit_details:0:8} -commit_date="${commit_details:41:4}${commit_details:46:2}${commit_details:49:2}" -release_version="0.0-${commit_date}-${commit_short_sha}" - -echo "HEAD commit: $commit_details" -echo "Date: $commit_date" -echo "Short SHA: $commit_short_sha" -echo "Release version: $release_version" - -## Creating directories - -project_dir="$work_dir/google-closure-library" -src_dir="$project_dir/src/main/resources" - -third_party_project_dir="$work_dir/google-closure-library-third-party" -third_party_src_dir="$third_party_project_dir/src/main/resources" - -mkdir -p "$src_dir" "$third_party_src_dir" - -## Generate deps.js -../closure_deps_graph.sh - -## Normalize deps.js -perl -p -i -e 's/\]\);/\], \{\}\);/go' \ - "$closure_library_base/goog/deps.js" - -perl -p -i -e 's/..\/..\/third_party\/closure\/goog\///go' \ - "$closure_library_base/goog/deps.js" - -perl -p -i -e "s/goog.addDependency\('base.js', \[\], \[\], \{\}\);/goog.addDependency\(\'base.js\', \[\'goog\'\], \[\], \{\}\);/go" \ - "$closure_library_base/goog/deps.js" - -## Copy Closure sources - -cp -r \ - "$closure_library_dir/AUTHORS" \ - "$closure_library_dir/LICENSE" \ - "$closure_library_dir/README.md" \ - "$closure_library_dir/closure/goog" \ - "$src_dir" - -cp -r \ - "$closure_library_dir/AUTHORS" \ - "$closure_library_dir/LICENSE" \ - "$closure_library_dir/README.md" \ - "$closure_library_dir/third_party/closure/goog" \ - "$third_party_src_dir" - -## Modify main deps.js for third-party JAR; see CLJS-276: - -perl -p -i -e 's/..\/..\/third_party\/closure\/goog\///go' \ - "$src_dir/goog/deps.js" - -## Remove empty third-party deps.js and base.js - -rm -f \ - "$third_party_src_dir/goog/deps.js" \ - "$third_party_src_dir/goog/base.js" - -## Generate the POM files: - -perl -p -e "s/RELEASE_VERSION/$release_version/go" \ - "$POM_TEMPLATE_FILE" \ - > "$project_dir/pom.xml" - -perl -p -e "s/RELEASE_VERSION/$release_version/go" \ - "$THIRD_PARTY_POM_TEMPLATE_FILE" \ - > "$third_party_project_dir/pom.xml" - -## Deploy the files if we are on Hudson - -if [ "$HUDSON" = "true" ]; then - ( - cd "$third_party_project_dir" - mvn -ntp -B --fail-at-end \ - -Psonatype-oss-release \ - -Dsource.skip=true \ - clean deploy - ) - - ( - cd "$project_dir" - mvn -ntp -B --fail-at-end \ - -Psonatype-oss-release \ - -Dsource.skip=true \ - clean deploy - ) - - echo "Now log in to https://oss.sonatype.org/ to release" - echo "the staging repository." -else - echo "Not on Hudson, local Maven install" - ( - cd "$third_party_project_dir" - mvn clean - mvn -ntp -B package - mvn install:install-file -Dfile=./target/google-closure-library-third-party-$release_version.jar -DpomFile=pom.xml - ) - ( - cd "$project_dir" - mvn clean - mvn -ntp -B package - mvn install:install-file -Dfile=./target/google-closure-library-$release_version.jar -DpomFile=pom.xml - ) -fi diff --git a/script/closure-library-release/google-closure-library-third-party.pom.template b/script/closure-library-release/google-closure-library-third-party.pom.template deleted file mode 100644 index b04c2cfa3..000000000 --- a/script/closure-library-release/google-closure-library-third-party.pom.template +++ /dev/null @@ -1,142 +0,0 @@ - - 4.0.0 - org.clojure - google-closure-library-third-party - RELEASE_VERSION - jar - Google Closure Library Third-Party Extensions - - - org.sonatype.oss - oss-parent - 9 - - - http://code.google.com/p/closure-library/ - - - The Google Closure Library is a collection of JavaScript code - designed for use with the Google Closure JavaScript Compiler. - - This non-official distribution was prepared by the ClojureScript - team at http://clojure.org/ - - This package contains extensions to the Google Closure Library - using third-party components, which may be distributed under - licenses other than the Apache license. Licenses for individual - library components may be found in source-code comments. - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - Note: the Google Closure library third-party extensions - contain code under a variety of licenses, which may be found - in source-code comments in each file. - - - - - - Google - http://www.google.com - - - - - Google, Inc. - - - Mohamed Mansour - hello@mohamedmansour.com - - - Bjorn Tipling - bjorn.tipling@gmail.com - - - SameGoal LLC - help@samegoal.com - - - Guido Tapia - guido.tapia@gmail.com - - - Andrew Mattie - amattie@gmail.com - - - Ilia Mirkin - ibmirkin@gmail.com - - - Ivan Kozik - ivan.kozik@gmail.com - - - Rich Dougherty - rich@rd.gen.nz - - - - - scm:https://github.com/google/closure-library.git - - - scm:git:https://github.com/google/closure-library.git - - https://github.com/google/closure-library - - - - code.google.com - http://code.google.com/p/closure-library/issues - - - - - sonatype-oss-release - - - - - org.apache.maven.plugins - maven-deploy-plugin - 2.7 - - true - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.4.4 - - - default-deploy - deploy - - - deploy - - - - - - https://oss.sonatype.org/ - - sonatype-nexus-staging - - - - - - - diff --git a/script/closure-library-release/google-closure-library.pom.template b/script/closure-library-release/google-closure-library.pom.template deleted file mode 100644 index 05f421d11..000000000 --- a/script/closure-library-release/google-closure-library.pom.template +++ /dev/null @@ -1,140 +0,0 @@ - - 4.0.0 - org.clojure - google-closure-library - RELEASE_VERSION - jar - Google Closure Library - - - org.sonatype.oss - oss-parent - 9 - - - http://code.google.com/p/closure-library/ - - - The Google Closure Library is a collection of JavaScript code - designed for use with the Google Closure JavaScript Compiler. - - This non-official distribution was prepared by the ClojureScript - team at http://clojure.org/ - - - - - org.clojure - google-closure-library-third-party - RELEASE_VERSION - - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - - - - Google - http://www.google.com - - - - - Google, Inc. - - - Mohamed Mansour - hello@mohamedmansour.com - - - Bjorn Tipling - bjorn.tipling@gmail.com - - - SameGoal LLC - help@samegoal.com - - - Guido Tapia - guido.tapia@gmail.com - - - Andrew Mattie - amattie@gmail.com - - - Ilia Mirkin - ibmirkin@gmail.com - - - Ivan Kozik - ivan.kozik@gmail.com - - - Rich Dougherty - rich@rd.gen.nz - - - - - scm:https://github.com/google/closure-library.git - - - scm:git:https://github.com/google/closure-library.git - - https://github.com/google/closure-library - - - - code.google.com - http://code.google.com/p/closure-library/issues - - - - - sonatype-oss-release - - - - - org.apache.maven.plugins - maven-deploy-plugin - 2.7 - - true - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.4.4 - - - default-deploy - deploy - - - deploy - - - - - - https://oss.sonatype.org/ - - sonatype-nexus-staging - - - - - - - diff --git a/script/closure_deps_graph.clj b/script/closure_deps_graph.clj deleted file mode 100644 index 094cd7b05..000000000 --- a/script/closure_deps_graph.clj +++ /dev/null @@ -1,39 +0,0 @@ -(ns closure-deps-graph - (:require [clojure.java.io :as io]) - (:import [java.io File] - [com.google.javascript.jscomp SourceFile BasicErrorManager] - [com.google.javascript.jscomp.deps - BrowserModuleResolver - DepsGenerator DepsGenerator$InclusionStrategy ModuleLoader - ModuleLoader$PathResolver])) - -(defn js-files-in - "Return a sequence of all .js files in the given directory." - [dir] - (filter - #(let [name (.getName ^File %)] - (and (.endsWith name ".js") - (not= \. (first name)))) - (file-seq dir))) - -(spit (io/file "closure-library/closure/goog/deps.js") - (.computeDependencyCalls - (DepsGenerator. - [] - (map #(SourceFile/fromFile (.getAbsolutePath %)) - (mapcat (comp js-files-in io/file) - ["closure-library/closure/goog" "closure-library/third_party/closure/goog"])) - DepsGenerator$InclusionStrategy/ALWAYS - (.getAbsolutePath (io/file "closure-library/closure/goog")) - (proxy [BasicErrorManager] [] - (report [level error] - (println error)) - (println [level error] - (println error))) - (-> (ModuleLoader/builder) - (.setErrorHandler nil) - (.setModuleRoots []) - (.setInputs []) - (.setFactory BrowserModuleResolver/FACTORY) - (.setPathResolver ModuleLoader$PathResolver/ABSOLUTE) - (.build))))) diff --git a/script/closure_deps_graph.sh b/script/closure_deps_graph.sh deleted file mode 100755 index cf62b423b..000000000 --- a/script/closure_deps_graph.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash - -set -e - -if [[ -z "$CLJS_SCRIPT_QUIET" ]]; then - set -x -fi - -FILE_SEP='/' -PATH_SEP=':' -OS_ID=`uname | tr [:upper:] [:lower:]` -CLJS_SCRIPT_MVN_OPTS=${CLJS_SCRIPT_MVN_OPTS:-""} - -if [[ $OS_ID == *mingw* ]] -then - echo "MINGW detected" - # Refer to http://www.mingw.org/wiki/Posix_path_conversion - FILE_SEP='//' - PATH_SEP=';' -fi - -CP_FILE=`mktemp /tmp/cljs_cp.txt.XXXXXXXXXXX` - -mvn -ntp -B -f ../../pom.template.xml dependency:build-classpath -Dmdep.outputFile=$CP_FILE -Dmdep.fileSeparator=$FILE_SEP -Dmdep.pathSeparator=$PATH_SEP $CLJS_SCRIPT_MVN_OPTS - -CLJS_CP=`cat $CP_FILE` - -# For Hudson server -if [ "$HUDSON" = "true" ]; then - $JAVA_HOME/bin/java -server -cp "$CLJS_CP""$PATH_SEP""src/main/clojure" clojure.main ../closure_deps_graph.clj -else - java -server -cp "$CLJS_CP""$PATH_SEP""src/main/clojure" clojure.main ../closure_deps_graph.clj -fi