8 Commits
Author SHA1 Message Date
Robert Payne 587c6cf4d6 Use static VM's for EJS templates
Creates and re-use a static JSVirtualMachine when rendering EJS templates so watch mode doesn't break when old JSContext deallocate and deadlock the main thread.
2025-05-26 22:11:02 +12:00
Ruslan Alikhamov 66f3e6ed47 Separate EJSTemplate.swift for swift test and for swift build -c release (#1203)
* Attempt to resolve runtime issue

* Applied workaround for swift test
2023-09-18 22:18:58 +04:00
Ruslan Alikhamov ba63cd6b84 Linux Support (#1188)
* work in progress

* More conditional checks, less errors

* Further steps onto successful compilation

* Enabled try-catch back for macOS

* reverted redundant change

* Replaced getVaList with recommended withVaList

* Update FileParser + AttributesModifierSpec.swift

fixed wrong find-replace

* added missing import of CDispatch

* enabled fatalError instead of NSException

* enabled value(forKey:) for TypesCollection type

* removed commented import

* enabled sha256 for macOS

* Enabled sha256 hashing for Linux

* disabled JavaScriptTemplate tests under Linux

* added check for vendor for tests

* disabled value(forKeyPath:) calls under Linux

* reverted redundant gem

* Fixed issue with `swift test` not finding .ejs bundle

* removed commented code

* switched to `swift test`

* enabled GH actions

* Temporary check for installed Xcodes - Update swift.yml

* Temporary checking Xcode versions - Update swift.yml

* Temporary setting Xcode version - Update swift.yml

* Temporary remove custom Ruby installation - Update swift.yml

* Removed spaces from filenames

* removed + from filenames

* Added -enable-testing for all test targets

* Try Xcode 15 beta

* trying to generate LinuxMain

* refactoring

* running a test for test of a test

* set SPM version to 5.8

* added tests to LinuxMain.swift

* removed redundantly disabled code

* fixed wrong ifdef

* Moved diffable implementation to definitions

* fixed failing UTs

* replaced os(macOS) with canImport(ObjectiveC)

* replaced more os(macOS) with canImport(ObjectiveC)

* enabled filtering for sorted arrays on linux

* eliminating API unsupported by swift-corelibs-foundation

* enabled SourceryRuntime to compile under Linux

* isEqual overrides only for Darwin platforms

* Fixed all SourceryRuntime compilation errors; more green tests

* Disabled enum test case

* moved isEqual to definitions

* fatalError when DynamicMemberLookup fails

* disabled failing test

* disabled crashing test in DryOutputSpec

* Fixed more unit tests

* Fixed typo

* Added best effort sorting filter

* added missing dynamic member lookups

* Added missing dynamic member lookup

* fixed compilation error

* Take into account 1-off linebreak issue between Linux and macOS

* Removed diffable from content generation due to new structure

* added missing dynamic member lookups

* Added missing dynamic member lookup

* moving hashing into class definitions

* Moved description and hash into class definitions

* Added DynamicMemberLookup definition for SourceryRuntime

* Added comment why import Stencil is needed

* Added missing dynamic member lookup

* Removed redundant imports

* Fixed failing tests

* Adjusted test expectation for Linux

* Fixed SourcerySpec template combining test

* Temporary commit for CI verification

* Adjusted SwiftTemplateSpecs tests for Linux

* reverted redundant change

* enable more linux tests for CI verification

* Adjusted CodableContextTests for Linux

* Added more tests that are green

* enabled all tests except 3

* Remove verbosity from CI build

* Removed redundant steps from CI

* Reverted redundant change

* Testing job cancellation

* Added new dynamic member lookup to generated sources [no ci]

* Added different TypesCollection definition for Linux

* Make TypesCollection conform to DynamicMemberLookup only on Linux

* Moved TypesCollection to separate generated source file

* Moved Type to separate file for Linux

* Split GitHub actions

* removed common GH action

* added separate file for Variable on linux

* removed DynamicMemberLookup conformance on macOS

* removed @objc conditions on Linux

* Temporary commit to fix build error

* moved NSException workaround to separate file

* Fixed compiler warning

* moved Types to a separate file

* moved generated Types to a separate file

* split Enum.swift into separate files

* removed redundant imports

* added missing import

* Removed redundant import

* Split Method into separate files

* Added DynamicMemberLookup to Method on Linux [no ci]

* removed redundant override

* added badges for GH Actions

* Fixed failing test on macOS

* Split Tuple into separate files for Linux

* Split EnumCase into separate file for DynamicMemberLookup on Linux

* Enabled GeneratorSpec tests

* Added missing lookup member

* Fixed SourcerySpecTests

* enabled SourcerySpec tests

* Added missing lookup member

* call runCLI on Linux

* Disabled codegen for Sourcery

* Added missing member lookup

* Added missing members lookup

* renamed Linux to include experimental

* Added missing member lookups

* Added missing import

* Adjusted padding [no ci]

* Added missing member lookups

* Adjusted padding [no ci]

* Disabled Codable tests on Linux

* enabled all tests classes under Linux

* Added AssociatedValue for Linux

* Added missing member lookups

* Changed resource copy path in TemplatesTests for Linux

* Updated CHANGELOG

* Added LINUX.md

* Added references to README and LINUX

* Updated content.generated files

* Fixed a typo [no ci]

* Changed wording related to @objc attribute

* Use currentTimestamp() instead of Date().timeIntervalSince1970

* Returned guard statements; removed default values from EJSTemplate
2023-09-07 23:27:22 +04:00
Krzysztof Zablocki 9b69d17df2 chore: revert using Bundle.module because it doesn't resolve correctly atm 2021-05-12 13:34:18 +02:00
Krzysztof ZabłockiandHeMet e834936a0c SPM & 5.4 (#951)
* WIP

* Fix path to the resources of test target

* Introduce SourceryLib target for testing purpose. It is the same as Sourcery but library, not executable.

Reason: linker has problems linking test target against executable.

* Import main target as SourceryLib when appropriate

* Re-enable specs that cause linker errors previously. JS spec left disabled since it needs additional configuration

* Add instruction how to fix error while running tests from Xcode

* No need to set ejsPath manually when framework is built with SPM anymore. Re-enable JS spec.

* Fix file references and build settings

* Use single define `SPM` that is set when the project is built by SPM

* Add CodableContextTests

* Fix build when building with SPM alone

* WIP TemplatesTests

* Fix executable name

* Update TemplatesTests

* Fix compilation of Xcode's project

* Add note

* Replace SPM flag with SWIFT_PACKAGE

* Revert Code signing settings

* Use release version of Nimble

* Point Quick to 3.0.0 version

* Optimize imports

* Exclude some files

* Fix error message

* Update template

* Change wording

* Add entry to CHANGELOG

* Rakefile: fix path to ejs.js

* Rakefile: fix path to ejs.js #2

* CircleCI config: fix path to ejs.js

* Add location of lib_InternalSwiftSyntaxParser.dylib to the -rpath

* Use bundled version of lib_InternalSwiftSyntaxParser.dylib

* Fix Nimble dependency

* Update -rpath of executable too. Otherwise it won't find the library when launched during TemplatesTests.

* Fix imports

Add 'import Foundation'

* Updated bundled sources

* feat: remove xcodeproj and add 5.4

* chore: update rakefile

* chore: update docs

* chore: cleanup rakefile

* chore: disable coverage since it won't work with spm only setup

Co-authored-by: HeMet <hemet.mail@gmail.com>
2021-05-02 11:37:18 +02:00
Krzysztof Zablocki 03d0d57bb1 feat: add .sourcerytemplate support 2021-04-20 15:16:19 +02:00
Ilya Puchka 25aa1563ea Allow using JS templates with SPM (#508)
* allow js templates for spm builds

* do not print misleading warning

* updated docs

* fallback to executable path

* renamed ejsbundle.js to ejs.js
2018-02-06 11:23:57 +01:00
Ilya Puchka df44f4fd51 Moved js templates to a separate framework (#503) 2018-01-29 11:25:28 +01:00