Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hibernate 5.4 extension updates #36

Open
wants to merge 153 commits into
base: 5.4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
cd7b05d
📖 DOC: Add project README
michaelborn Jan 19, 2023
a0ff160
📖 DOC: Add javadocs generation to ant build
michaelborn Jan 19, 2023
63aff0e
🐛 FIX: Update Maven pom.xml to get Maven builds working
michaelborn Jan 20, 2023
d3266be
🤖 TEST: Set up Junit tests via Maven
michaelborn Jan 20, 2023
73a9939
🤖 CI: Add Maven build for junit tests
michaelborn Jan 20, 2023
c32d642
👌IMPROVE: Refactor deprecated setEl() usage for static Dialects struct
michaelborn Jan 20, 2023
946b1bf
👌IMPROVE: Drop commented code, add javadocs to Dialect class
michaelborn Jan 20, 2023
33fb012
👌 IMPROVE: Ignore all temporay build directories
michaelborn Jan 20, 2023
b3b1c2e
📦 NEW: Add Dialect.getDialects() for seeing all available dialect opt…
michaelborn Jan 20, 2023
a5ad71b
📖 DOC: Add Javadocs to Transaction object
michaelborn Jan 20, 2023
8a6ce8d
👌 IMPROVE: Drop unused CFCEntityResolver class
michaelborn Jan 20, 2023
d553f6e
📖 DOC: More javadocs work, fix all javadoc warnings
michaelborn Jan 20, 2023
2235075
📦 NEW: Add auto-generation of Javadocs via Maven
michaelborn Jan 20, 2023
b3a066b
🐛 FIX: Switch to Java 8 for Maven builds
michaelborn Jan 20, 2023
0fe2d15
🐛 FIX: Don't use update-snapshot
michaelborn Jan 20, 2023
032e07d
📖 DOC: Fix invalid javadocs
michaelborn Jan 20, 2023
2198aa1
📖 DOC: Additional javadocs for main class
michaelborn Jan 20, 2023
addb57a
👌 IMPROVE: Update gitignore for ROOT build artifacts
michaelborn Jan 20, 2023
948d3cf
📖 DOC: Update javadocs
michaelborn Jan 21, 2023
6bbb031
🤖 TEST: Add basic junit tests for future expansion
michaelborn Jan 23, 2023
2980665
📦 NEW: Add getTransaction() to Hibernate transaction wrapper
michaelborn Jan 23, 2023
b21bd61
👌 IMPROVE: Update Lucee build version
michaelborn Jan 23, 2023
ca0aad2
🤖 TEST: Update and streamline event handler tests
michaelborn Jan 24, 2023
a7ab519
🐛 FIX: Refactor and fix events handling
michaelborn Jan 24, 2023
09a8246
👌 IMPROVE: Drop dead datasourceManager code from CommonUtil
michaelborn Jan 24, 2023
fcbd2ab
📦 NEW: Add .fld, .tld XML config for custom Lucee tags and functions
michaelborn Jan 25, 2023
c997777
🤖 TEST: Add test.bash for easier test runs
michaelborn Jan 25, 2023
8031e96
👌 IMPROVE: Filter node_modules and .git from IDE resources
michaelborn Jan 25, 2023
e116049
📦 NEW: Import ORM* and Entity* functions from Lucee core
michaelborn Jan 25, 2023
c0879cd
🐛 FIX: Updates to ORM functions so they can compile outside of Lucee …
michaelborn Jan 25, 2023
00681de
👌 IMPROVE: Copy in additional Decision and Caster methods for CommonUtil
michaelborn Jan 25, 2023
ec4ae15
📦 NEW: New ExceptionUtil helper methods
michaelborn Jan 25, 2023
ac5abbf
⚠ BREAKING: Drop support for Application.lucee files
michaelborn Jan 25, 2023
eb519f5
🤖 TEST: Ignore WEB-INF directory generated during tests
michaelborn Jan 25, 2023
4054642
🤖 TEST: Fix parent directory paths in test.sh bash runner
michaelborn Jan 25, 2023
794f53b
🤖 TEST: Update main.yml notes
michaelborn Jan 26, 2023
faf74a6
🐛 FIX: Fix bugs from Lucee core import
michaelborn Jan 26, 2023
548c19e
🤖 TESTS: Delete broken EventListenIntegratorTest
michaelborn Jan 26, 2023
41f0d86
👌 IMPROVE: Rework ORM init/reinit logic
michaelborn Jan 27, 2023
b066b34
👌 IMPROVE: Drop unused or unnecessary imports
michaelborn Jan 27, 2023
e8d0dd0
👌 IMPROVE: More sessionFactory initialization cleanup
michaelborn Jan 27, 2023
888a2cb
📖 DOC: More Javadocs
michaelborn Jan 30, 2023
cbf99de
🐛 FIX: Don't close session on transaction end (LDEV-4017)
michaelborn Jan 30, 2023
b1266c8
👌 IMPROVE: Avoid deprecated Hibernate setFlushMode() method
michaelborn Jan 30, 2023
4bf9a16
👌 IMPROVE: Switch internal _delete() method to private
michaelborn Jan 30, 2023
8174c01
📖 DOCS: More Java docs updates
michaelborn Jan 30, 2023
8646146
📖 DOCS: Update compiled javadocs
michaelborn Jan 30, 2023
20a0005
🤖 TEST: Add test for LDEV-4150, varchar(length)
michaelborn Jan 30, 2023
866c11e
🐛 FIX: Append col length to varchar/nvarchar mapping (LDEV-4150)
michaelborn Jan 30, 2023
cd36e0b
📖 DOCS: Clean up javadocs warnings and re-generate
michaelborn Jan 30, 2023
26835fd
🤖 TESTS: Add support and docs for database platform tests
michaelborn Jan 30, 2023
943fb45
🤖 TESTS: Fix missing junit test result path
michaelborn Jan 30, 2023
6efae85
🤖 TESTS: Another lucee version variable attempt
michaelborn Jan 30, 2023
0d9aec0
📖 DOCS: Attempt to fix failing javadoc builds
michaelborn Jan 30, 2023
cada873
🤖 CI: Set up GHA token for committing javadocs to repo
michaelborn Jan 30, 2023
a8fe4c0
📘 DOC: Rebuild API Javadocs
michaelborn Jan 30, 2023
87a4771
📘 DOC: Rebuild API Javadocs
michaelborn Jan 30, 2023
42118ad
📘 DOC: Rebuild API Javadocs
michaelborn Jan 30, 2023
2751cb8
📘 DOC: Rebuild API Javadocs
michaelborn Jan 30, 2023
963ff18
📘 DOC: Rebuild API Javadocs
michaelborn Jan 30, 2023
15f99aa
📘 DOC: Rebuild API Javadocs
michaelborn Jan 30, 2023
3142b6f
🤖 CI: Only commit javadocs changes
michaelborn Jan 30, 2023
5b3df4f
📘 DOC: Rebuild API Javadocs
michaelborn Jan 30, 2023
91aa8f3
📘 DOC: Rebuild API Javadocs
michaelborn Jan 30, 2023
ec77a9a
🤖 CI: Avoid recursive / infinite javadocs builds due to triggering on…
michaelborn Jan 30, 2023
6f6bd37
Merge branch 'FORK' of github.com:michaelborn/extension-hibernate-for…
michaelborn Jan 30, 2023
bcc265a
📘 DOC: Rebuild API Javadocs __CI__
michaelborn Jan 30, 2023
b7d0d5d
🤖 CI: Avoid triggering more builds after Javadocs commit
michaelborn Jan 30, 2023
5230dc5
🤖 CI: Enable JDK and Lucee build matrix for basic compilation
michaelborn Jan 30, 2023
279c407
📘 DOC: Rebuild API Javadocs __CI__
michaelborn Jan 30, 2023
7f6a02f
🤖 CI: Tweak JVM builds
michaelborn Jan 30, 2023
4ceb985
Merge branch 'FORK' of github.com:michaelborn/extension-hibernate-for…
michaelborn Jan 30, 2023
122cc68
📘 DOC: Rebuild API Javadocs __CI__
michaelborn Jan 30, 2023
1ae877a
👌 IMPROVE: Update deprecated call to get connection string
michaelborn Jan 30, 2023
a59f4bc
👌 IMPROVE: Move HBM load/save methods to HBMCreator class
michaelborn Jan 30, 2023
b1fe7ee
👌 IMPROVE: Drop unused ORMConfiguration argument from loadMapping
michaelborn Jan 31, 2023
2fc53ef
👌 IMPROVE: Rework XML mapping save/load methods for autoGenMap=false …
michaelborn Jan 31, 2023
6cac457
🤖 TESTS: Add test for component datasource attribute
michaelborn Jan 31, 2023
5fc76c0
📦 NEW: Enable autoGenMap support
michaelborn Jan 31, 2023
e630a55
👌 IMPROVE: Move saveMapping config check to caller
michaelborn Jan 31, 2023
b24d3dc
👌 IMPROVE: Use getMappingResource for CFC hbm mapping filename
michaelborn Jan 31, 2023
63d9a7e
👌 IMPROVE: Drop unused ORMConfiguration argument from createMappings
michaelborn Jan 31, 2023
b166b72
👌 IMPROVE: Move doctype references to HBMCreator.java
michaelborn Jan 31, 2023
aa4aa49
⚠ BREAKING: Drop support for .lucee entity names
michaelborn Jan 31, 2023
84f3f3c
Merge branch 'FORK' of github.com:michaelborn/extension-hibernate-for…
michaelborn Jan 31, 2023
4f75c3c
📘 DOC: Rebuild API Javadocs __CI__
michaelborn Jan 31, 2023
681b068
👌 IMPROVE: Rework HBM generation and loading for autoGenMap support
michaelborn Feb 1, 2023
82c2043
🤖 TESTS: Commit missing Application.cfc's for testing
michaelborn Feb 1, 2023
60a4f4c
🤖 TESTS: Test autogenmap=false with hbm.xml files to import
michaelborn Feb 1, 2023
c6535a1
Merge branch 'FORK' of github.com:michaelborn/extension-hibernate-for…
michaelborn Feb 1, 2023
af7c96f
📘 DOC: Rebuild API Javadocs __CI__
michaelborn Feb 1, 2023
c43c60e
🤖 CI: Add auto-formatter to maven build
michaelborn Feb 1, 2023
9585318
📖 DOCS: More README updates
michaelborn Feb 1, 2023
c68cba8
Merge branch 'FORK' of github.com:michaelborn/extension-hibernate-for…
michaelborn Feb 1, 2023
c4c3ad9
👌 IMPROVE: Format all Java source code to Eclipse style guide
michaelborn Feb 1, 2023
a969c97
👌 IMPROVE: Stop saving datasource test XML files to disk
michaelborn Feb 1, 2023
f43419c
📘 DOC: Rebuild API Javadocs __CI__
michaelborn Feb 1, 2023
b2f1d31
🤖 CI: Fix mvn build
michaelborn Feb 1, 2023
f82c857
Merge branch 'FORK' of github.com:michaelborn/extension-hibernate-for…
michaelborn Feb 1, 2023
731762d
📘 DOC: Rebuild API Javadocs __CI__
michaelborn Feb 1, 2023
93bd392
🤖 CI: Fix test result publish, wrong JVM errors in GHA builds
michaelborn Feb 1, 2023
66fad31
🤖 CI: fix invalid yaml syntax
michaelborn Feb 1, 2023
ccbace7
📘 DOC: Rebuild API Javadocs __CI__
michaelborn Feb 1, 2023
306e2da
🤖 CI: Add support for future .lex uploads to S3
michaelborn Feb 1, 2023
33d3c28
📖 DOC: More readme updates
michaelborn Feb 1, 2023
c0fdc92
🤖 TEST: Add basic test for ormConfig support
michaelborn Feb 2, 2023
4c51369
👌 IMPROVE: Drop redundant FORMAT_SQL configuration
michaelborn Feb 2, 2023
d342d21
👌 IMPROVE: Use Hibernate setting key names if they exist
michaelborn Feb 2, 2023
9462da4
📖 DOCS: Javadocs for session factory config setup
michaelborn Feb 2, 2023
2e1455e
🤖 TEST: Add ehcache test
michaelborn Feb 2, 2023
0edede7
👌 IMPROVE: Switch to AvailableSettings keys for ehcache config
michaelborn Feb 2, 2023
d988746
📖 DOCS: Javadocs for component imports
michaelborn Feb 2, 2023
6f2e34d
👌 IMPROVE: Rename createMappings() for clarity
michaelborn Feb 2, 2023
69854bb
📖 DOCS: More sessionFactoryData javadocs
michaelborn Feb 2, 2023
24c4115
👌 IMPROVE: Move *Util classes to .util package
michaelborn Feb 2, 2023
c7d74a4
👌 IMPROVE: Move configuration setup into ConfigurationBuilder
michaelborn Feb 3, 2023
929fff4
🤖 TEST: Add test for ConfigurationBuilder
michaelborn Feb 3, 2023
eb19f07
🤖 CI: Tweak jdk version / compiler version props in build
michaelborn Feb 3, 2023
179b72e
Merge branch 'FORK' of github.com:michaelborn/extension-hibernate-for…
michaelborn Feb 3, 2023
1576997
📘 DOC: Rebuild API Javadocs __CI__
michaelborn Feb 3, 2023
c00e275
👌 IMPROVE: Drop unused aprint and print classes
michaelborn Feb 3, 2023
96eb530
👌 IMPROVE: Drop unused Entity interface
michaelborn Feb 3, 2023
461e423
👌 IMPROVE: Drop unused imports
michaelborn Feb 3, 2023
928f9ce
👌 IMPROVE: Drop unused init arguments
michaelborn Feb 3, 2023
31fdb6c
👌 IMPROVE: Stop using deprecated getAddional() method on PageException
michaelborn Feb 3, 2023
65f44cf
👌 IMPROVE: Run maven source formatter
michaelborn Feb 3, 2023
a5f4b89
🤖 TEST: Drop unused mock from test
michaelborn Feb 3, 2023
b551195
👌 IMPROVE: Drop unused pageContext arg from isApplicationName()
michaelborn Feb 3, 2023
70482ce
🤖 TEST: Add basic HibernateUtilTest
michaelborn Feb 3, 2023
faac697
🤖 BUILD: More Maven dependency work
michaelborn Feb 6, 2023
3d4e7d2
🤖 TEST: Drop unused datasources from ORM tests
michaelborn Feb 6, 2023
fa396f2
🤖 BUILD: More maven build work
michaelborn Feb 6, 2023
38ff61e
LDEV-4073 update to ehcache-2.10.9.2
zspitzer Sep 16, 2022
4271c5f
🤖 TEST: Add and tweak tests for LDEV-3907, LDEV-4150
michaelborn Feb 6, 2023
8c511d7
Revert "LDEV-4073 update to ehcache-2.10.9.2"
michaelborn Feb 7, 2023
f05fee4
📖 DOCS: More TODOs in the README 😜
michaelborn Feb 7, 2023
2a72b68
🤖 TEST: Add tests for transaction savepoint
michaelborn Feb 7, 2023
914dc8a
Merge branch 'FORK' of github.com:michaelborn/extension-hibernate-for…
michaelborn Feb 9, 2023
05aa470
📘 DOC: Rebuild API Javadocs __CI__
michaelborn Feb 9, 2023
86d0efa
👌 IMPROVE: Code consolidation and minor improvements
michaelborn Feb 9, 2023
96eb03c
📖 DOCS: Update readme for PR-ing to Hibernate extension
michaelborn Feb 10, 2023
779abb8
🤖 CI: Drop S3 upload work-in-progress
michaelborn Feb 10, 2023
7605a21
📖 DOCS: Drop apidocs from committed repo
michaelborn Feb 10, 2023
214dd22
🤖 CI: Add docker-compose for database testing
michaelborn Feb 10, 2023
7739a04
🤖 TEST: Drop disabled Junit tests
michaelborn Feb 11, 2023
7cd4705
👌 IMPROVE: Drop commented code for reinits during entity creation
michaelborn Feb 11, 2023
0d5f777
🤖 CI: Switch javadocs to upload to S3
michaelborn Feb 14, 2023
934dddc
📖 DOCS: Update copyright notice to LAS, not Railo
michaelborn Feb 16, 2023
c9bc612
🤖 TEST: Add and tweak tests for LDEV-3907, LDEV-4150
michaelborn Feb 6, 2023
f07ec69
Merge branch 'HEAD' into patch/5.4-hibernate-updates
Mar 1, 2023
c94e4c8
📖 DOC: More javadocs work
michaelborn Mar 31, 2023
c2a5434
Update built-ins to extend Lucee's BIF class for performance per Micha
michaelborn May 1, 2023
e98ee04
Drop .tld xml config as it is unused
michaelborn May 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 103 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,60 +3,157 @@

name: Java CI

on: [push, pull_request,workflow_dispatch]
on: [push, pull_request, workflow_dispatch]

jobs:
build:

runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '__CI__')"
env:
luceeVersion: light-6.0.0.316-SNAPSHOT
luceeVersion: 6.0.0.316-SNAPSHOT

steps:
- uses: actions/checkout@v3

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
distribution: 'temurin'

- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: lucee-script-runner-maven-cache

- name: Cache Lucee files
uses: actions/cache@v3
with:
path: _actions/lucee/script-runner/main/lucee-download-cache
key: lucee-downloads-${{ env.luceeVersion }}
restore-keys: |
lucee-downloads

- name: Build with Ant
run: ant -noinput -verbose -buildfile build.xml

- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: hibernate-lex
path: dist/*.lex

- name: Checkout Lucee
uses: actions/checkout@v3
with:
repository: lucee/lucee
path: lucee
- name: Run Lucee Test Suite (testFilter="orm")

- name: Run Lucee Test Suite (testLabels="orm")
uses: lucee/script-runner@main
with:
webroot: ${{ github.workspace }}/lucee/test
execute: /bootstrap-tests.cfm
luceeVersion: ${{ env.luceeVersion }}
luceeVersion: light-${{ env.luceeVersion }}
extensionDir: ${{ github.workspace }}/dist
env:
testLabels: orm
testAdditional: ${{ github.workspace }}/tests

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
if: always()
with:
files: ${{ github.workspace }}/lucee/test/reports/junit-test-results.xml
files: ${{ github.workspace }}/lucee/test/reports/junit-test-results-${{env.luceeVersion}}.xml
check_name: "Test Results"

maven_build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '__CI__')"
strategy:
fail-fast: false
matrix:
lucee_version: ["5.3.10.97"]
java_version: [ "8", "11", "17" ]

steps:
- uses: actions/checkout@v3

- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '${{matrix.java_version}}'
distribution: 'temurin'

- name: Build with Maven
run: mvn --batch-mode -f pom.xml -Dlucee.version=${{matrix.lucee_version}} -Djdk.version=${{matrix.java_version}} compile

javadocs:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '__CI__')"
steps:
- uses: actions/checkout@v3

- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'

- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: maven-cache

- name: Generate Javadocs
run: mvn --batch-mode -f pom.xml javadoc:javadoc

- name: Get Project Version for Javadocs Versioning
id: current_version
# For Maven builds (future)
# run: echo "VERSION=`mvn help:evaluate -Dexpression=project.version -q -DforceStdout`" >> $GITHUB_ENV
# For Ant builds (still the default)
run: echo "VERSION=`ant -silent -quiet version`" >> $GITHUB_ENV

- name: Upload API Docs to S3
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read
env:
AWS_S3_BUCKET: ${{ secrets.AWS_APIDOCS_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }}
SOURCE_DIR: "docs"
DEST_DIR: "lucee/hibernate-extension/${{ env.VERSION }}/"

format:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '__CI__')"
steps:
- uses: actions/checkout@v3
with:
token: ${{secrets.GH_TOKEN}}

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'

- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: maven-cache

- name: Format Java source code
run: mvn --batch-mode -f pom.xml formatter:format

- name: Commit formatting changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
file_pattern: "docs"
commit_message: "🤖 CI: Auto-format Java source __CI__"
24 changes: 18 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
/dist
temp
**/.DS_Store
# Editor and OS artifacts
.vscode
.DS_Store
**/.svn/
/*.project
va specific

# build files/dist
/bin
/build
/dist
/temp
*.class
target
target/*
/target
*.lock
*.DS_Store
/cache
/cache
/docs

# Test artifacts
WEB-INF/

# Lucee source for CFML tests
/lucee
78 changes: 78 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Lucee Hibernate Extension (ORM)

[![Java CI](https://github.com/lucee/extension-hibernate/actions/workflows/main.yml/badge.svg?branch=5.4)](https://github.com/lucee/extension-hibernate/actions/workflows/main.yml) 5.4

[![Java CI](https://github.com/lucee/extension-hibernate/actions/workflows/main.yml/badge.svg?branch=3.5.5)](https://github.com/lucee/extension-hibernate/actions/workflows/main.yml) 3.5.5

[![Java CI](https://github.com/lucee/extension-hibernate/actions/workflows/main.yml/badge.svg)](https://github.com/lucee/extension-hibernate/actions/workflows/main.yml) Master

* A [Hibernate ORM](https://hibernate.org/orm/) wrapper for the [Lucee CFML language](https://www.lucee.org/)

* Issues: https://luceeserver.atlassian.net/issues/?jql=labels%20%3D%20%22orm%22
* Documentation: https://docs.lucee.org/categories/orm.html

## Contributing

You will need to install the following for extension development:

* Java 1.8+ (JRE and JDK)
* [ant](https://www.osradar.com/install-apache-ant-ubuntu-20-04/) (for building the extension `.lex` file)
* [maven](https://linuxize.com/post/how-to-install-apache-maven-on-ubuntu-20-04/) (for other automated tooling)
* [Docker](https://docs.docker.com/engine/install/) and [Docker Compose](https://docs.docker.com/compose/install/) (for managing test database servers)

### Getting Started

1. Install the repo - `git clone [email protected]:lucee/extension-hibernate.git`
2. Make changes..
3. [Build extension via `ant dist`](#building)
4. Test via `./test.sh` (See [#Testing](#testing) for more info)

**Before you send a PR:**

1. Don't forget to run tests!
1. (if you can't get tests to pass, ask for help!)
2. Format java source code: `mvn formatter:format`

## Building

Using ant builds (for now):

* `ant clean` - clean build directories
* `ant compile` - compile code
* `ant dist` - Package the extension into a Lucee-installable `.lex` extension file

Using the Maven builds:

* `mvn test` run java-based (junit) tests
* `mvn javadoc:javadoc` generate java docs
* `mvn formatter:format` [format java source](https://code.revelc.net/formatter-maven-plugin/usage.html)
* `mvn verify` Run OWASP dependency checker to look for vulnerabilities

## Testing

See Lucee documentation on [testing-a-lucee-extension-locally](https://docs.lucee.org/guides/working-with-source/building-and-testing-extensions.html#testing-a-lucee-extension-locally).

To run CFML tests against the extension:

1. Check out [lucee/Lucee](https://github.com/lucee/lucee) to the parent directory - `git clone [email protected]:lucee/Lucee.git ../lucee`
2. Check out [lucee/script-runner](https://github.com/lucee/script-runner) to the parent directory - `git clone [email protected]:lucee/Lucee.git ../script-runner`.

Next, start the test databases using the Docker-compose setup:

```bash
cd tests && docker-compose up
```

This will start Postgres, MySQL, and MSSQL containers using the credentials specified in `tests/.env`.

Finally, you can run tests from the extension root:

```bash
./test.sh
```

To build a .lex and test it immediately, chain `ant dist` and `./test.sh`:

```bash
ant dist && ./test.sh
```
20 changes: 18 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
<property name="dist" location="dist"/>
<property name="src" location="source/java/src"/>
<property name="srcImg" location="source/images"/>

<property name="docs.dir" location="docs/"/>
<property name="tld" location="source/tld"/>
<property name="fld" location="source/fld"/>

<buildnumber file="build.number"/>


Expand All @@ -38,6 +41,10 @@
<mkdir dir="${dist}/extension/jars"/>
</target>

<!-- Output the project version for use in versioning S3 artifact uploads -->
<target name="version">
<echo>${bundleversion}${build.number}${versionAppendix}</echo>
</target>

<target name="copy" depends="init" description="copy source file to temp" >
<!-- copy the source -->
Expand Down Expand Up @@ -78,10 +85,19 @@ lucee-core-version: "${luceeCoreVersion}"
<classpath refid="classpath" />
</javac>
</target>

<!-- Generate javadocs for current project into ${doc.dir} -->
<target name="doc" depends="init" description="generate documentation">
<javadoc sourcepath="${src}" destdir="${docs.dir}"/>
</target>

<target name="dist" depends="compile"
description="generate the distribution" >


<!-- copy the flds used for informing Lucee of the CFML built-in methods -->
<copy file="${fld}/ormFunctions.fld" tofile="${dist}/extension/flds/ormFunctions.fld" />
<replace file="${dist}/extension/flds/ormFunctions.fld" token="{bundle-name}" value="${bundlename}" />
<replace file="${dist}/extension/flds/ormFunctions.fld" token="{bundle-version}" value="${bundleversion}${build.number}${versionAppendix}" />

<!-- Put everything in ${build} into .jar file -->
<jar
Expand Down
Loading