Skip to content

Commit 36dab8c

Browse files
committed
feat: support marmot
1 parent a05ae79 commit 36dab8c

File tree

5 files changed

+56
-0
lines changed

5 files changed

+56
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.DS_Store
22
build
33
*/build
4+
node_modules/
45
bin
56
gen
67
local.properties

android_app_bootstrap/build.gradle

+5
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,8 @@ dependencies {
3939
implementation 'com.alibaba:fastjson:1.2.38'
4040
implementation 'com.airbnb.android:lottie:2.5.4'
4141
}
42+
43+
ext {
44+
buildVersionName = '1.0'
45+
buildVersionCode = '0.2'
46+
}

ci.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
3+
gradle clean build -PdisablePreDex --stacktrace
4+
5+
npm i
6+
7+
npm run marmot

marmot.config.js

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
'use strict';
2+
3+
const fs = require('fs');
4+
const path = require('path');
5+
const helper = require('marmot-cli/lib/helper');
6+
7+
const pkg = require('./package');
8+
9+
const dotGradle = path.join(__dirname, pkg.name, 'build.gradle');
10+
const dotGradleContent = fs.readFileSync(dotGradle, 'utf8');
11+
12+
module.exports = async function () {
13+
const gradle = await helper
14+
.androidUtils
15+
.parseGradle(dotGradleContent);
16+
17+
console.log(JSON.stringify(gradle, null, 2));
18+
const version = `${gradle.ext.buildVersionName}.${gradle.ext.buildVersionCode}`;
19+
const outputPath = `${pkg.name}/build/outputs`;
20+
return {
21+
files: [
22+
`${outputPath}/`,
23+
],
24+
packages: [
25+
{
26+
version,
27+
type: 'debug',
28+
path: `${outputPath}/apk/debug/debug/${pkg.name}.apk`
29+
}
30+
],
31+
testInfo: {
32+
},
33+
extraInfo: {
34+
}
35+
};
36+
};
37+

package.json

+6
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,15 @@
99
"android_app_bootstrap/build/outputs/apk/android_app_bootstrap-debug.apk",
1010
"index.js"
1111
],
12+
"scripts": {
13+
"marmot": "marmot report -c ./marmot.config.js"
14+
},
1215
"repository": {
1316
"type": "git",
1417
"url": "git://github.com/app-boostrap/android-app-bootstrap.git"
1518
},
19+
"devDependencies": {
20+
"marmot-cli": "^1.0.0"
21+
},
1622
"license": "MIT"
1723
}

0 commit comments

Comments
 (0)