Skip to content

Commit 5d89c4f

Browse files
author
Brenton Bostick
committed
Initial Commit
0 parents  commit 5d89c4f

16 files changed

+4625
-0
lines changed

.WolframResources

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Resources[
2+
Version[1],
3+
ExecutionBuildCommand["<<Format`"],
4+
Paclet[
5+
PacletFolder["Format"],
6+
FunctionPaclet[False]
7+
]
8+
]

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
build

.project

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>Format</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>com.wolfram.eclipse.MEET.MathematicaProjectBuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>com.wolfram.eclipse.MEET.SimpleMathematicaNature</nature>
16+
</natures>
17+
</projectDescription>

CMakeLists.txt

+163
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
2+
cmake_minimum_required(VERSION 3.0)
3+
4+
project(format)
5+
6+
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
7+
8+
set(PACLET "Format")
9+
set(WOLFRAMKERNEL /Applications/Mathematica.app/Contents/MacOS/WolframKernel CACHE FILEPATH "Path to WolframKernel")
10+
set(BUILD_DOCS OFF CACHE BOOL "Build documentation")
11+
12+
message(STATUS "PACLET: ${PACLET}")
13+
message(STATUS "WOLFRAMKERNEL: ${WOLFRAMKERNEL}")
14+
message(STATUS "BUILD_DOCS: ${BUILD_DOCS}")
15+
16+
set(WL_PACLET_SOURCES
17+
${CMAKE_SOURCE_DIR}/Format/Kernel/Format.wl
18+
${CMAKE_SOURCE_DIR}/Format/Kernel/Utils.wl
19+
)
20+
21+
set(PACLETINFO_SOURCE
22+
${CMAKE_SOURCE_DIR}/Format/PacletInfo.m
23+
)
24+
25+
set(DOCUMENTATION_NOTEBOOK_PATHS
26+
27+
)
28+
29+
#
30+
# Setup documentation notebook paths
31+
#
32+
foreach(NB_PATH ${DOCUMENTATION_NOTEBOOK_PATHS})
33+
set(SRC ${CMAKE_SOURCE_DIR}/${PACLET}/Documentation/${NB_PATH})
34+
set(BUILT ${CMAKE_BINARY_DIR}/paclet/${PACLET}/Documentation/${NB_PATH})
35+
list(APPEND DOCUMENTATION_SOURCE ${SRC})
36+
list(APPEND BUILT_DOCUMENTATION ${BUILT})
37+
endforeach()
38+
39+
40+
41+
#
42+
# Set VERSION_NUMBER, SYSTEMID, and PACLET_VERSION
43+
#
44+
include(WolframKernel)
45+
CheckWolframKernel()
46+
47+
48+
49+
file(MAKE_DIRECTORY
50+
${CMAKE_BINARY_DIR}/paclet/${PACLET}
51+
)
52+
53+
54+
#
55+
# Copy WL source files
56+
#
57+
add_custom_command(
58+
OUTPUT ${CMAKE_BINARY_DIR}/paclet/${PACLET}/PacletInfo.m
59+
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/${PACLET}/PacletInfo.m ${CMAKE_BINARY_DIR}/paclet/${PACLET}/PacletInfo.m
60+
MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/${PACLET}/PacletInfo.m)
61+
list(APPEND COPIED_WL_PACLET_SOURCES ${CMAKE_BINARY_DIR}/paclet/${PACLET}/PacletInfo.m)
62+
63+
foreach(SRC ${WL_PACLET_SOURCES})
64+
get_filename_component(BARE_SRC ${SRC} NAME)
65+
add_custom_command(
66+
OUTPUT ${CMAKE_BINARY_DIR}/paclet/${PACLET}/Kernel/${BARE_SRC}
67+
COMMAND ${CMAKE_COMMAND} -E copy ${SRC} ${CMAKE_BINARY_DIR}/paclet/${PACLET}/Kernel/${BARE_SRC}
68+
MAIN_DEPENDENCY ${SRC})
69+
list(APPEND COPIED_WL_PACLET_SOURCES ${CMAKE_BINARY_DIR}/paclet/${PACLET}/Kernel/${BARE_SRC})
70+
endforeach()
71+
72+
set(PACLET_SOURCES
73+
${COPIED_WL_PACLET_SOURCES}
74+
)
75+
76+
77+
78+
79+
if(BUILD_DOCS)
80+
81+
list(APPEND PACLET_SOURCES
82+
${BUILT_DOCUMENTATION}
83+
)
84+
85+
endif(BUILD_DOCS)
86+
87+
88+
89+
90+
91+
#
92+
# docs target
93+
#
94+
95+
if(BUILD_DOCS)
96+
97+
add_custom_target(docs
98+
DEPENDS
99+
${BUILT_DOCUMENTATION}
100+
)
101+
102+
set(DOCS_APPPATH /Applications/Eclipse.app/Contents/Eclipse/configuration/org.eclipse.osgi/525/0/.cp/MathematicaSource/ CACHE PATH "Path of MathematicaSource inside Workbench installation")
103+
104+
message(STATUS "DOCS_APPPATH: ${DOCS_APPPATH}")
105+
106+
if (NOT IS_DIRECTORY ${DOCS_APPPATH})
107+
message(FATAL_ERROR "DOCS_APPPATH (${DOCS_APPPATH}) does not exist")
108+
endif(NOT IS_DIRECTORY ${DOCS_APPPATH})
109+
110+
set(DOCS_JLINKPATH /Applications/Mathematica.app/Contents/SystemFiles/Links/JLink/ CACHE PATH "Path of JLink")
111+
112+
message(STATUS "DOCS_JLINKPATH: ${DOCS_JLINKPATH}")
113+
114+
if (NOT IS_DIRECTORY ${DOCS_JLINKPATH})
115+
message(FATAL_ERROR "DOCS_JLINKPATH (${DOCS_JLINKPATH}) does not exist")
116+
endif(NOT IS_DIRECTORY ${DOCS_JLINKPATH})
117+
118+
119+
#
120+
# build the docs
121+
#
122+
add_custom_command(
123+
OUTPUT
124+
${BUILT_DOCUMENTATION}
125+
DEPENDS
126+
${DOCUMENTATION_SOURCE}
127+
COMMAND
128+
ant -DmathExe=${WOLFRAMKERNEL} -DappPath=${DOCS_APPPATH} -Djlinkpath=${DOCS_JLINKPATH} -DinputDir=${CMAKE_SOURCE_DIR}/${PACLET}/Documentation/ -DoutputDir=${CMAKE_BINARY_DIR}/paclet/${PACLET}/Documentation/ -file ${DOCS_APPPATH}/DocumentationBuild/SystemFiles/ant/Build/notebook.xml
129+
WORKING_DIRECTORY
130+
${CMAKE_SOURCE_DIR}
131+
)
132+
133+
endif(BUILD_DOCS)
134+
135+
136+
137+
138+
139+
140+
#
141+
# paclet target
142+
#
143+
add_custom_target(paclet
144+
DEPENDS ${CMAKE_BINARY_DIR}/paclet/${PACLET}-${PACLET_VERSION}.paclet
145+
)
146+
147+
#
148+
# Pack the paclet
149+
#
150+
add_custom_command(
151+
OUTPUT
152+
${CMAKE_BINARY_DIR}/paclet/${PACLET}-${PACLET_VERSION}.paclet
153+
DEPENDS
154+
${PACLET_SOURCES}
155+
COMMAND
156+
${WOLFRAMKERNEL} -noinit -noprompt -run PackPaclet["${CMAKE_BINARY_DIR}/paclet/${PACLET}"]\;Exit[]
157+
VERBATIM
158+
WORKING_DIRECTORY
159+
${CMAKE_SOURCE_DIR}
160+
)
161+
162+
163+

CONTRIBUTING.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Contributing to Wolfram<sup>&reg;</sup>
2+
3+
Thank you for taking the time to contribute to the [Wolfram Research](https://github.com/wolframresearch) repos on GitHub.
4+
5+
## Licensing of Contributions
6+
7+
By contributing to Wolfram, you agree and affirm that:
8+
9+
> Wolfram may release your contribution under the terms of the [MIT license](https://opensource.org/licenses/MIT); and
10+
11+
> You have read and agreed to the [Developer Certificate of Origin](http://developercertificate.org/), version 1.1 or later.
12+
13+
Please see [LICENSE](LICENSE) for licensing conditions pertaining
14+
to individual repositories.
15+
16+
17+
## Bug reports
18+
19+
### Security Bugs
20+
21+
Please **DO NOT** file a public issue regarding a security issue.
22+
Rather, send your report privately to [email protected]. Security
23+
reports are appreciated and we will credit you for it. We do not offer
24+
a security bounty, but the forecast in your neighborhood will be cloudy
25+
with a chance of Wolfram schwag!
26+
27+
### General Bugs
28+
29+
Please use the repository issues page to submit general bug issues.
30+
31+
Please do not duplicate issues.
32+
33+
Please do send a complete and well-written report to us. Note: **the
34+
thoroughness of your report will positively correlate to our willingness
35+
and ability to address it**.
36+
37+
When reporting issues, always include:
38+
39+
* Your version of *Mathematica*<sup>&reg;</sup> or the Wolfram Language<sup>&trade;</sup>.
40+
* Your operating system.

0 commit comments

Comments
 (0)