Skip to content

Commit

Permalink
Merge pull request #10 from joewiz/fix-build
Browse files Browse the repository at this point in the history
fix(ci): pull in build & CI changes from aws.xq
  • Loading branch information
joewiz committed Apr 20, 2024
2 parents d805188 + 143a768 commit 03ecd26
Show file tree
Hide file tree
Showing 10 changed files with 14,255 additions and 1,846 deletions.
97 changes: 10 additions & 87 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,87 +1,10 @@
# =========================
# Operating System Files
# =========================

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk

# =========================
# OSX
# =========================

.DS_Store
.AppleDouble
.LSOverride

# Thumbnails
._*

# =========================
# Files that might appear in the root of a volume
# =========================

.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
# Network Trash Folder
Temporary Items
.apdisk


# =========================
# Application Files
# =========================

~$*.xlsx
.~lock*

# =========================
# exist-db specific files
# =========================

*.xar
.existdb.json
query-results

# =========================
# other
# =========================

.yo-rc.json
node_modules/
coverage
build/
bower_components/
.idea
reports/
*.code-workspace

# =========================
# tei-pub (gulp)
# =========================
webtest/bin
webtest/reports
webtest/errorShots
build/*
.*
!.gitignore
!.releaserc
!.github/
expath-pkg.xml
repo.xml
.vscode/
.idea/
node_modules/
10 changes: 10 additions & 0 deletions build.properties.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<root>
<app>
<name>airtable</name>
<url>http://joewiz.org/ns/pkg/airtable</url>
<title>airtable.xq</title>
<!-- VERSION SET AUTOMATICALLY DO NOT CHANGE -->
<!-- <version>0.1.0</version> -->
</app>
</root>
89 changes: 71 additions & 18 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<project default="all" name="airtable.xq">
<description>A library for the Airtable REST API and Metadata API</description>
<xmlproperty file="expath-pkg.xml"/>
<property name="project.version" value="${package(version)}"/>
<property name="project.app" value="airtable.xq"/>
<project default="xar" name="airtable.xq" basedir=".">
<xmlproperty file="build.properties.xml" semanticAttributes="true" keepRoot="false"/>
<property name="build.dir" value="build"/>
<!-- Start it -->
<target name="init" description="create build directory">
<tstamp/>
<mkdir dir="${build.dir}"/>
</target>
<!-- Release build -->
<target name="xar" depends="init" description="compile release build">
<zip basedir="." destfile="${build.dir}/${project.app}.xar"
excludes="**/${build.dir}/**, .existdb.json, bower.json.ignores, .yo-rc.json, **/node_modules/**, **/reports/**, README.md, **/.git*/**"
/>
<property name="git.repo.path" value="${basedir}/.git"/>
<available file="${git.repo.path}" type="dir" property="git.present"/>

<target name="clean">
<echo message="Deleting xar files..."/>
<delete dir="${build.dir}" failonerror="false"/>
<delete file="${basedir}/expath-pkg.xml" failonerror="false"/>
<delete file="${basedir}/repo.xml" failonerror="false"/>
</target>
<target name="all" depends="xar">
<tstamp/>

<target name="xar" depends="clean,git.revision" description="create xar file">
<echo message="Creating build folder..."/>
<mkdir dir="${build.dir}"/>

<echo message="Apply values to expath-pkg.xml..."/>
<copy todir="${basedir}" overwrite="true" verbose="true">
<fileset file="*.xml.tmpl"/>
<filterchain>
<replacetokens>
<token key="name" value="${app.name}"/>
<token key="version" value="${app.version}"/>
<token key="url" value="${app.url}"/>
<token key="title" value="${app.title}"/>
<token key="commit-id" value="${git.revision}"/>
<token key="commit-time" value="${git.time}"/>
</replacetokens>
<tokenfilter>
<!-- until we move template processing to XSLT, take care with reserved characters -->
<replacestring from="&amp;" to="&amp;amp;"/>
</tokenfilter>
</filterchain>
<globmapper from="*.tmpl" to="*"/>
</copy>

<echo message="------------------------------------------------------------"/>
<echo message="Creating xar file..."/>
<echo message="------------------------------------------------------------"/>

<zip basedir="${basedir}" destfile="${build.dir}/${app.name}.xar">
<exclude name="${build.dir}/**"/>
<exclude name="*.tmpl"/>
<exclude name=".github/**"/>
<exclude name="test/**"/>
<exclude name="node_modules/**"/>
</zip>
</target>
</project>

<target name="git.revision" description="Store git revision in ${repository.version}" if="git.present">
<exec executable="git" outputproperty="git.revision" failifexecutionfails="false" errorproperty="">
<arg value="--git-dir=${git.repo.path}"/>
<arg value="rev-parse"/>
<arg value="HEAD"/>
</exec>
<condition property="repository.version" value="${git.revision}" else="unknown">
<and>
<isset property="git.revision"/>
<length string="${git.revision}" trim="yes" length="0" when="greater"/>
</and>
</condition>
<echo>Git repo: ${repository.version}</echo>

<exec executable="git" outputproperty="git.time" failifexecutionfails="false" errorproperty="">
<arg value="--git-dir=${git.repo.path}"/>
<arg value="show"/>
<arg value="-s"/>
<arg value="--format=%ct"/>
<arg value="${git.revision}"/>
</exec>
<echo>Git time: ${git.time}</echo>
</target>
</project>
8 changes: 8 additions & 0 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'body-max-line-length': [1, 'always', 200],
'type-empty': [1, 'never'],
'subject-empty': [1, 'never']
}
}
4 changes: 2 additions & 2 deletions expath-pkg.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://expath.org/ns/pkg" name="http://joewiz.org/ns/pkg/airtable" abbrev="airtable"
version="1.0.3" spec="1.0">
<package abbrev="airtable" name="http://joewiz.org/ns/pkg/airtable" spec="1.0" version="${app.version}"
xmlns="http://expath.org/ns/pkg">
<title>airtable.xq</title>
<dependency processor="http://exist-db.org" semver-min="5.0.0"/>
<xquery>
Expand Down
10 changes: 10 additions & 0 deletions expath-pkg.xml.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<package abbrev="@name@" name="@url@" spec="1.0" version="@version@"
xmlns="http://expath.org/ns/pkg">
<title>@title@</title>
<dependency processor="http://exist-db.org" semver-min="5.0.0"/>
<xquery>
<namespace>http://joewiz.org/ns/xquery/airtable</namespace>
<file>airtable.xqm</file>
</xquery>
</package>
Loading

0 comments on commit 03ecd26

Please sign in to comment.