Skip to content

Commit 9672025

Browse files
author
Mikael Kindborg
committed
Moved libraries to new repository 'evothings-libraries', updated build script to fetch library files from this repo.
1 parent 8077b0c commit 9672025

File tree

27 files changed

+541
-6883
lines changed

27 files changed

+541
-6883
lines changed

README.md

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,42 @@
11
# Examples for Evothings Studio
22

3-
Apps in folder 'generated/examples' are included in the [Evothings Studio download](http://evothings.com/dowload).
3+
## Example app bundled with Evothings Studio
44

5-
Apps in folder 'generated/experiments' are under development and are not guaranteed to work.
5+
Apps in folder [generated/examples](https://github.com/evothings/evothings-examples/tree/master/generated/examples) are included in the [Evothings Studio download](http://evothings.com/dowload).
6+
7+
## Folder structure
8+
9+
Apps in folder [generated/experiments](https://github.com/evothings/evothings-examples/tree/master/generated/experiments) are under development and are not guaranteed to work. These are not bundled with Evothings Studio.
610

711
Example app source files are in folders 'examples' and 'experiments'. Note that these cannot be run as is. If you wish to run the examples in Evothings Viewer or build a stand-alone Cordova app, use the code in folder 'generated'.
812

9-
JavaScript libraries and CSS files shared across apps are in folder 'resources'.
13+
To add an app to Evothings Workbench that is not included with the download, drag and drop the index.html file of the app you wish to add into the Workbench window.
14+
15+
CSS files and other files shared across apps are in folder 'resources'.
16+
17+
## Library files
18+
19+
Library files used by the example apps are found in repository [evothings-libraries](https://github.com/evothings/evothings-libraries).
20+
21+
## Build script
1022

11-
The Ruby script 'build.rb' copies relevant files from 'resources' to 'generated'.
23+
If you wish to build the files in the 'generated' folder yourself, use the Ruby script 'build.rb'. This script copies files from folders 'examples', 'experiments' and 'resources' to the target folder 'generated'. Library files from 'evothings-libraries' are also copied to 'generated'.
24+
25+
Note that the 'evothings-libraries' repo must be in a sibling folder to this repo for the build script to work. Like this:
26+
27+
parent-folder
28+
evothings-libraries
29+
evothings-examples
30+
build.rb (run using command 'ruby build.rb')
1231

1332
<!-- To remove files copied by 'build.rb', run 'git clean -fdX'. -->
1433

34+
## Documentation
35+
36+
[Documentation for example apps](https://evothings.com/doc/examples/examples.html) is available at the [Evothings documentation web site](https://evothings.com/doc/).
37+
38+
## It is quick and fun to get started with Evothings Studio
39+
1540
Download Evothings Studio at: [http://evothings.com](http://evothings.com)
1641

1742
It is fast and fun to get started!

build.rb

Lines changed: 43 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,34 @@
88

99
include FileUtils::Verbose
1010

11+
### Path to libraries ###
12+
13+
# Libraries are in repository evothings-libraries. This repo
14+
# has to be cloned to a sibling folder to evothings-examples.
15+
16+
# Get the path to library files.
17+
def libraryPath(sourcePath)
18+
'../evothings-libraries/' + sourcePath
19+
end
20+
21+
### Paths to generated examples ###
22+
23+
# Destination path for generated files.
24+
def fullDestPath(destPath)
25+
'generated/' + destPath
26+
end
27+
28+
# Build generated examples.
29+
def buildGenerated
30+
copyDir(
31+
'examples',
32+
'generated')
33+
copyDir(
34+
'experiments',
35+
'generated')
36+
buildExamples
37+
end
38+
1139
###### Examples ######
1240

1341
def buildMbedGAP
@@ -340,80 +368,77 @@ def writeSettingsFile(destPath, imageFile)
340368

341369
def copyUI(destPath)
342370
copyDir('resources/ui', fullDestPath(destPath))
343-
copyDir('resources/libs/evothings/ui', fullDestPath(destPath) + '/libs/evothings')
371+
copyDir(libraryPath('libs/evothings/ui'), fullDestPath(destPath) + '/libs/evothings')
344372
end
345373

346374
def copyJQuery(destPath)
347-
copyDir('resources/libs/jquery', fullDestPath(destPath) + '/libs')
375+
copyDir(libraryPath('libs/jquery'), fullDestPath(destPath) + '/libs')
348376
end
349377

350378
def copyEvothings(destPath)
351379
copyDir(
352-
'resources/libs/evothings/evothings.js',
353-
fullDestPath(destPath) + '/libs/evothings')
354-
copyDir(
355-
'resources/libs/evothings/version-1.2.0',
380+
libraryPath('libs/evothings/evothings.js'),
356381
fullDestPath(destPath) + '/libs/evothings')
357382
end
358383

359384
def copyEasyBLE(destPath)
360385
copyUtil(destPath)
361386
copyDir(
362-
'resources/libs/evothings/easyble',
387+
libraryPath('libs/evothings/easyble'),
363388
fullDestPath(destPath) + '/libs/evothings')
364389
end
365390

366391
def copyArduinoBLE(destPath)
367392
copyEasyBLE(destPath)
368393
copyDir(
369-
'resources/libs/evothings/arduinoble',
394+
libraryPath('libs/evothings/arduinoble'),
370395
fullDestPath(destPath) + '/libs/evothings')
371396
end
372397

373398
def copyArduinoTCP(destPath)
374399
copyDir(
375-
'resources/libs/evothings/arduinotcp',
400+
libraryPath('libs/evothings/arduinotcp'),
376401
fullDestPath(destPath) + '/libs/evothings')
377402
end
378403

379404
def copyNordic_nRF51822_BLE(destPath)
380405
copyEasyBLE(destPath)
381406
copyDir(
382-
'resources/libs/evothings/nordic-nRF51822-ble',
407+
libraryPath('libs/evothings/nordic-nRF51822-ble'),
383408
fullDestPath(destPath) + '/libs/evothings')
384409
end
385410

386411
def copyNordic_nRF51_BLE(destPath)
387412
copyEasyBLE(destPath)
388413
copyDir(
389-
'resources/libs/evothings/nordic-nRF51-ble',
414+
libraryPath('libs/evothings/nordic-nRF51-ble'),
390415
fullDestPath(destPath) + '/libs/evothings')
391416
end
392417

393418
def copyRFduinoBLE(destPath)
394419
copyEasyBLE(destPath)
395420
copyDir(
396-
'resources/libs/evothings/rfduinoble',
421+
libraryPath('libs/evothings/rfduinoble'),
397422
fullDestPath(destPath) + '/libs/evothings')
398423
end
399424

400425
def copyTISensorTag(destPath)
401426
copyEasyBLE(destPath)
402427
copyDir(
403-
'resources/libs/evothings/tisensortag',
428+
libraryPath('libs/evothings/tisensortag'),
404429
fullDestPath(destPath) + '/libs/evothings')
405430
end
406431

407432
def copyEddystone(destPath)
408433
copyEasyBLE(destPath)
409434
copyDir(
410-
'resources/libs/evothings/eddystone',
435+
libraryPath('libs/evothings/eddystone'),
411436
fullDestPath(destPath) + '/libs/evothings')
412437
end
413438

414439
def copyUtil(destPath)
415440
copyDir(
416-
'resources/libs/evothings/util',
441+
libraryPath('libs/evothings/util'),
417442
fullDestPath(destPath) + '/libs/evothings')
418443
end
419444

@@ -427,13 +452,13 @@ def copyWhereIsTheArduinoCode(destPath)
427452

428453
def copyArduinoEthernet(destPath)
429454
copyDir(
430-
'resources/arduino/arduinoethernet',
455+
libraryPath('arduino/arduinoethernet'),
431456
fullDestPath(destPath) + '/arduinoethernet')
432457
end
433458

434459
def copyArduinoWiFi(destPath)
435460
copyDir(
436-
'resources/arduino/arduinowifi',
461+
libraryPath('arduino/arduinowifi'),
437462
fullDestPath(destPath) + '/arduinowifi')
438463
end
439464

@@ -494,21 +519,6 @@ def buildExamples
494519
# TODO: buildTemplateEddystoneApp
495520
end
496521

497-
498-
### Destination path for generated files ###
499-
500-
def fullDestPath(destPath)
501-
'generated/' + destPath
502-
end
503-
504-
def buildGenerated
505-
copyDir(
506-
'examples',
507-
'generated')
508-
copyDir(
509-
'experiments',
510-
'generated')
511-
buildExamples
512-
end
522+
# Build the examples.
513523

514524
buildGenerated

0 commit comments

Comments
 (0)