Skip to content

Commit

Permalink
readme work for 1.0 #25 #26 #30 (#31)
Browse files Browse the repository at this point in the history
* work on test options

* work on examples

* work on examples

* build examples on circleci

* run examples on circleci

* readme

* readme

* readme

* big shuffle

* hide stuff

* readme work

* done enough
  • Loading branch information
Matthew James Briggs committed Apr 8, 2019
1 parent 18660e2 commit 64f99b6
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 56 deletions.
27 changes: 2 additions & 25 deletions .circleci/Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,5 @@ FROM matthewjamesbriggs/mxci:v001
ENV BASEDIR="/mx"
WORKDIR $BASEDIR
COPY . .

RUN echo "#! /bin/bash\n" >> /usr/bin/docker-entrypoint.sh \
echo "set -e\n" >> /usr/bin/docker-entrypoint.sh \
echo "cmake --version\n" >> /usr/bin/docker-entrypoint.sh \
echo "cmake -DMX_BUILD_TESTS=on -DMX_BUILD_CORE_TESTS=on -DMX_BUILD_EXAMPLES=on .\n" >> /usr/bin/docker-entrypoint.sh \
echo "make -j12\n" >> /usr/bin/docker-entrypoint.sh \
echo "./MxHide\n" >> /usr/bin/docker-entrypoint.sh \
echo "./MxWrite\n" >> /usr/bin/docker-entrypoint.sh \
echo "./MxRead\n" >> /usr/bin/docker-entrypoint.sh \
echo "./MxTest\n" >> /usr/bin/docker-entrypoint.sh && \
chmod +x /usr/bin/docker-entrypoint.sh

CMD "/usr/bin/docker-entrypoint.sh"

# CMD cmake --version && \
# cmake \
# -DMX_BUILD_TESTS=on \
# -DMX_BUILD_CORE_TESTS=on \
# -DMX_BUILD_EXAMPLES=on \
# . && \
# && \
# ./MxTest && \
# ./MxRead && \
# ./MxWrite && \
# ./MxHide
RUN chmod +x .circleci/dockerfile-test-entrypoint.sh
CMD [".circleci/dockerfile-test-entrypoint.sh"]
46 changes: 46 additions & 0 deletions .circleci/dockerfile-test-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#! /bin/bash
set -e

sep() {
echo "----------------------------------------------------------------"
}

sep
echo "version info"
g++ --version
cmake --version
cat /etc/os-release

sep
cmake \
-DMX_BUILD_TESTS=on \
-DMX_BUILD_CORE_TESTS=off \
-DMX_BUILD_EXAMPLES=on \
.

sep
make -j12

sep
echo "running MxHide"
./MxHide
echo "success"

sep
echo "running MxWrite"
./MxWrite
echo "success"

sep
echo "running MxRead"
./MxRead
echo "success"

sep
echo "running MxTest"
./MxTest
echo "success"

echo ""
echo "done running script - success"
exit 0
56 changes: 25 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,57 +9,51 @@ MusicXML Class Library

-----------------------------------------

Master: [![CircleCI](https://circleci.com/gh/webern/mx.svg?style=svg)](https://circleci.com/gh/webern/mx)
Develop: [![CircleCI](https://circleci.com/gh/webern/mx/tree/develop.svg?style=svg)](https://circleci.com/gh/webern/mx/tree/develop)
![CircleCI](https://circleci.com/gh/webern/mx.svg?style=svg&circle-token=2f4d1a33a0825d9634b458a2306ed22482314661)

Badges seem to be [broken](https://github.com/github/markup/issues/224), go to the [CircleCI project](https://circleci.com/gh/webern/mx) for build status.

## Introduction
This project is a C++ class library for working with MusicXML files. MusicXML filea are represented in a strongly-typed object-oriented class structure. MusicXML can be deserialized into the class structure and serialized from class structure to MusicXML.

One of the goals of this project is to strongly-type all aspects of the MusicXML XSD specification such that **any program that compiles will represent a valid MusicXML document.** This principle is only extended as far as XSD validation is concerned. The MusicXML specification allows for the creation of valid MusicXML documents which are nonetheless musical gibberish. Additionally the MusicXML specification has many requirements which are described in comments in the XSD specification. In other words, an XSD-validated MusicXML document does not necessarily represent valid MusicXML.
## Introduction

Note: XsIDREF and XsID constraints are not enforced by this library. Thus the goal stated above has not entirely been achieved. If you introduce duplicative XsID values, for example, an XSD validation of your document will fail and most implementors will throw when reading your MusicXML file. I don't know how to solve this problem right now.
This project is a C++ library for working with MusicXML files. MusicXML files are represented in a statically typed objects. This structure can be serialized and deserialize to/from MusicXML.

## Compiling
The project has been built with the following compilers successfully.
* Xcode 7.3.1 Apple LLVM version 7.3.0 (clang-703.0.31)
* Visual Studio 2015

GCC is not working because GCC incorrectly implements the vector erase function with no overload that takes a const iterator. If you get it to compile with GCC please create a pull request. [Issue #6](https://github.com/Webern/MusicXML-Class-Library/issues/6) exists for the GCC problem. Here are the [GCC bugs](https://gcc.gnu.org/bugzilla/buglist.cgi?bug_id=55675%2C57158).
The project is working with:
* Xcode 10.1 Apple LLVM version 10.0.0 (clang-1000.11.45.5)
* g++ (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
* cmake version 3.7.2

To compile with Xcode, just open `YourRepoRoot/Xcode/mx.xcworkspace` and build.
Visual Studio should be very close to working. A good first pull request would be to compile with VS and add the version to the list above.

To compile with any other system, use cmake, here is a Visual Studio example
There are three cmake options:

```
git clone https://github.com/Webern/MusicXML-Class-Library.git MxRepo
mkdir MxBuild
cd MxBuild
cmake ..\MxRepo
start Mx.sln
-DMX_BUILD_TESTS=on
-DMX_BUILD_CORE_TESTS=off
-DMX_BUILD_EXAMPLES=on
```

Visual Studio will open with a solution file and be ready to compile.
The configuration shown above is the recommended configuration for development. If you just need the lib then turn off all three of the cmake options.

**Warning: The Tests Take Forever to Compile**: Both the Xcode workspace and the cmake project include compilation of the unit and integ tests. These take forever to compile. If you just want the Mx library and don't want the tests then you can either skip building the test project or you can comment out a few lines to prevent the test code from compiling.

`YourRepoRoot/Sourcecode/mxtest/control/CompileControl.h`
Here's an example of a clean build of the project followed by a test run.

```
// Comment out these defines below to
// prevent tests from compiling. The
// core tests take a long time to compile.
//#define MX_COMPILE_CORE_TESTS
//#define MX_COMPILE_IMPORT_TESTS
//#define MX_COMPILE_UTILTIY_TESTS
//#define MX_COMPILE_XML_TESTS
git clone https://github.com/webern/mx.git mx
mkdir build
cd build
cmake ../mx -DMX_BUILD_TESTS=on -DMX_BUILD_CORE_TESTS=off -DMX_BUILD_EXAMPLES=on
make -j6
./MxTest
```

## Usage
## API

The `mx::api` namespace is intended to be a (somewhat) simplified wrapping `api` for MusicXML. It should be slightly more intuitive than manipulating the DOM representation directly.
The `mx::api` namespace is intended to be a (somewhat) simplified structural representation of MusicXML. It should be slightly more intuitive than manipulating the DOM representation directly.

#### Writing MusicXML with `mx::api`

```C++
#include <string>
#include <iostream>
Expand Down

0 comments on commit 64f99b6

Please sign in to comment.