Skip to content

Commit e7301f5

Browse files
committed
Merge branch 'feature/semantic-release-integration' into develop
2 parents 7fa21ef + 9b560ec commit e7301f5

File tree

10 files changed

+8531
-10
lines changed

10 files changed

+8531
-10
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,7 @@ sysinfo.txt
3434
*.apk
3535
*.unitypackage
3636
/Logs/Packages-Update.log
37+
38+
# Node.js
39+
node_modules
40+
dist

.releaserc

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"plugins": [
3+
"@semantic-release/commit-analyzer",
4+
"@semantic-release/release-notes-generator",
5+
"@semantic-release/changelog",
6+
[
7+
"@semantic-release/exec",
8+
{
9+
"prepareCmd": "npm run build"
10+
}
11+
],
12+
"@semantic-release/git",
13+
[
14+
"@semantic-release/npm",
15+
{
16+
"pkgRoot": "dist"
17+
}
18+
],
19+
[
20+
"@semantic-release/github",
21+
{
22+
"assets": [
23+
{
24+
"path": "dist/**/*",
25+
"label": "Build"
26+
}
27+
]
28+
}
29+
]
30+
]
31+
}

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
language: node_js
2+
node_js:
3+
- "node"
4+
install:
5+
- npm install
6+
script:
7+
- commitlint-travis
8+
- npm run semantic-release

Assets/FluidBehaviorTree/package.json

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
{
22
"name": "com.fluid.behavior-tree",
3-
"version": "0.0.0",
3+
"version": "1.0.0",
44
"displayName": "Fluid Behavior Tree",
55
"description": "A micro-framework for creating Behavior Trees based upon the builder pattern",
66
"unity": "2018.1",
7-
"dependencies": {
8-
},
97
"keywords": [
108
"ai",
119
"behavior tree",
@@ -15,5 +13,15 @@
1513
"name": "Ash Blue",
1614
"email": "ash@blueashes.com",
1715
"url": "https://twitter.com/ashbluewd"
18-
}
19-
}
16+
},
17+
"license": "MIT",
18+
"repository": {
19+
"type": "git",
20+
"url": "git+https://github.com/ashblue/fluid-behavior-tree.git"
21+
},
22+
"bugs": {
23+
"url": "https://github.com/ashblue/fluid-behavior-tree/issues"
24+
},
25+
"homepage": "https://github.com/ashblue/fluid-behavior-tree#readme",
26+
"dependencies": {}
27+
}

LICENSE renamed to LICENSE.md

File renamed without changes.

README.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ https://www.youtube.com/watch?v=YCMvUCxzWz8
105105
+ [Custom Conditions](#custom-conditions)
106106
+ [Custom Composites](#custom-composites)
107107
+ [Custom Decorators](#custom-decorators)
108+
* [Development Environment](#development-environment)
108109
* [Submitting your own actions, conditions, ect](#submitting-code-to-this-project)
109110

110111
## Example Scene
@@ -558,11 +559,28 @@ public static class BehaviorTreeBuilderExtensions {
558559
}
559560
```
560561

562+
## Development Environment
563+
564+
If you wish to run to run the development environment you'll need to install [node.js](#). Then run the following from the root once.
565+
566+
`npm install`
567+
568+
If you wish to create a build run `npm run build` from the root and it will populate the `dist` folder.
569+
570+
### Making Commits
571+
572+
All commits should be made using [Commitizen](https://github.com/commitizen/cz-cli) (which is automatically installed when running `npm install`). Commits are automatically compiled to version numbers on release so this is very important. PRs that don't have Commitizen based commits will be rejected.
573+
574+
To make a commit type the following into a terminal from the root
575+
576+
```bash
577+
npm run commit
578+
```
579+
561580
## Submitting code to this project
562581

563-
Please fill out the following details if you'd like to contribute new code to this project.
582+
Please do the following if you wish to contribute code to this project.
564583

565-
1. Clone this project for the core code with tests
566-
2. Put your new code in a separate branch
567-
3. Make sure your new code is reasonably tested to demonstrate it works (see `*Test.cs` files)
568-
4. Submit a pull request to the `develop` branch
584+
1. Create your feature in a `feature` branch off of `develop`
585+
2. Make sure your new code is reasonably tested to demonstrate it works (see `*Test.cs` files)
586+
3. Submit a pull request to the `develop` branch

commitlint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = {extends: ['@commitlint/config-conventional']};

create-dist.js

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
const del = require('del');
2+
const copyDir = require('copy-dir');
3+
const fs = require('fs');
4+
5+
const OUTPUT = 'dist';
6+
const SOURCE = 'Assets/FluidBehaviorTree';
7+
const COPY_FILES = [
8+
'README.md',
9+
'CHANGELOG.md',
10+
'LICENSE.md',
11+
];
12+
13+
async function init () {
14+
await del([OUTPUT]);
15+
16+
copyFiles();
17+
crossPopulatePackages();
18+
fs.copyFileSync(`${SOURCE}/package.json`, `${OUTPUT}/package.json`);
19+
20+
console.log(`Copied files from ${SOURCE} to ${OUTPUT}`);
21+
}
22+
23+
function copyFiles() {
24+
copyDir.sync(SOURCE, OUTPUT, {});
25+
COPY_FILES.forEach((file) => {
26+
if (!fs.existsSync(file)) return;
27+
fs.copyFileSync(file, `${OUTPUT}/${file}`);
28+
});
29+
}
30+
31+
function crossPopulatePackages() {
32+
copyJsonFields('package.json', `${SOURCE}/package.json`, [
33+
'name',
34+
'displayName',
35+
'description',
36+
'version',
37+
'unity',
38+
'repository',
39+
'license',
40+
'bugs',
41+
'homepage',
42+
'keywords',
43+
'author',
44+
]);
45+
}
46+
47+
function copyJsonFields(sourcePath, destPath, fields) {
48+
const source = JSON.parse(fs.readFileSync(sourcePath).toString());
49+
const dest = JSON.parse(fs.readFileSync(destPath).toString());
50+
51+
fields.forEach((field) => {
52+
dest[field] = source[field];
53+
});
54+
55+
fs.writeFileSync(destPath, JSON.stringify(dest, null, 2));
56+
}
57+
58+
init();

0 commit comments

Comments
 (0)