Skip to content

Development

Gnohz Gniy edited this page May 14, 2024 · 6 revisions

Building MarkEdit

Building CoreEditor

After checking out the project, go to the root folder of the repository and run:

cd CoreEditor
yarn install
yarn build

To test the editor in a dev environment, run yarn dev instead, web interfaces are exposed to window.webModules.

Building MarkEditMac

After successfully building CoreEditor, open MarkEdit.xcodeproj, and build the MarkEditMac target.

It's recommended to override build settings by adding a Local.xcconfig file under the root folder, including code signing identity, development team, etc.

Note that you should always use the latest stable release of Xcode.

Testing MarkEdit Locally

Unit tests are run automatically by GitHub Actions, you can also run them on your machine.

Testing CoreEditor

Make sure dependencies are installed and run:

cd CoreEditor
yarn test

Testing MarkEditMac

MarkEditMac consists of several targets, here's an example of testing MarkEditCoreTests:

xcodebuild test -project MarkEdit.xcodeproj -scheme MarkEditCoreTests -destination 'platform=macOS'

Updating Dependencies

  • NPM packages: CoreEditor/package.json
  • Other 3rd-party code: CoreEditor/src/@vendor
  • JavaScript libraries: MarkEditMac/Modules/Sources/Previewer/Resources
  • SwiftLint: MarkEditTools/Plugins/SwiftLint

Notarization

  1. Archive and export a signed distribution (*.app), e.g., Developer ID distribution.
  2. Create an installer (*.dmg) with the create-dmg tool.
  3. Notarize the installer (*.dmg) with notarytool as below.
xcrun notarytool submit MarkEdit.dmg --keychain-profile "notarytool-password" --wait

xcrun notarytool log <request-id> --keychain-profile "notarytool-password" notarization-log.json

xcrun stapler staple MarkEdit.dmg

As a prerequisite, we need to config the credentials with xcrun notarytool store-credentials.

For more information, see Customizing the notarization workflow.

Submitting Cask Updates

brew bump-cask-pr markedit --version <version>

For more information, see #447.