Skip to content

Commit

Permalink
Fix Android
Browse files Browse the repository at this point in the history
  • Loading branch information
haslinghuis committed Dec 30, 2023
1 parent a51c0a6 commit 8dc6b56
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ module.exports = {
cordovaChromeapi: true,
appAvailability: true,
// end cordova bindings

// globals for vite
__APP_PRODUCTNAME__: "readonly",
__APP_VERSION__: "readonly",
__APP_REVISION__: "readonly",
'__APP_PRODUCTNAME__': "readonly",
'__APP_VERSION__': "readonly",
'__APP_REVISION__': "readonly",
},
// ignore src/dist folders
ignorePatterns: ["src/dist/*"],
Expand Down
22 changes: 19 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,8 @@ function processPackage(done, gitRevision, isReleaseBuild) {
}

function dist_src() {
const platforms = getPlatforms();

const distSources = [
'./src/**/*',
'!./src/**/*.js',
Expand All @@ -364,9 +366,22 @@ function dist_src() {
'./src/js/tabs/map.js',
];

return gulp.src(distSources, { base: 'src' })
.pipe(gulp.src('yarn.lock'))
.pipe(gulp.dest(DIST_DIR));
const distSourcesCordova = [
'./src/**/*',
'!./src/css/dropdown-lists/LICENSE',
'!./src/support/**',
'!./src/**/*.less',
];

if (platforms.indexOf('android') >= 0) {
return gulp.src(distSourcesCordova, { base: 'src' })
.pipe(gulp.src('yarn.lock'))
.pipe(gulp.dest(DIST_DIR));
} else {
return gulp.src(distSources, { base: 'src' })
.pipe(gulp.src('yarn.lock'))
.pipe(gulp.dest(DIST_DIR));
}
}

function dist_node_modules_css() {
Expand Down Expand Up @@ -1073,6 +1088,7 @@ function cordova_packagejson() {
return gulp.src(`${CORDOVA_DIST_DIR}package.json`)
.pipe(jeditor({
'name': metadata.name,
'productName': metadata.productName,
'description': metadata.description,
'version': metadata.version,
'author': metadata.author,
Expand Down
6 changes: 3 additions & 3 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ function serveLocalesPlugin() {

export default defineConfig({
define: {
'__APP_VERSION__': JSON.stringify(pkg.version),
'__APP_PRODUCTNAME__': JSON.stringify(pkg.productName),
'__APP_REVISION__': JSON.stringify(commitHash),
__APP_VERSION__: JSON.stringify(pkg.version),
__APP_PRODUCTNAME__: JSON.stringify(pkg.productName),
__APP_REVISION__: JSON.stringify(commitHash),
},
test: {
// NOTE: this is a replacement location for karma tests.
Expand Down

0 comments on commit 8dc6b56

Please sign in to comment.