Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PrivateStorageMobile
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jean-Paul Calderone
PrivateStorageMobile
Commits
46ad1e5a
Commit
46ad1e5a
authored
2 years ago
by
Jean-Paul Calderone
Browse files
Options
Downloads
Patches
Plain Diff
some customizations to set up gradle with chaquopy
parent
c6e21612
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
app/app/build.gradle
+11
-1
11 additions, 1 deletion
app/app/build.gradle
app/app/src/main/python/main.py
+14
-0
14 additions, 0 deletions
app/app/src/main/python/main.py
app/build.gradle
+1
-0
1 addition, 0 deletions
app/build.gradle
flake.nix
+64
-2
64 additions, 2 deletions
flake.nix
with
90 additions
and
3 deletions
app/app/build.gradle
+
11
−
1
View file @
46ad1e5a
plugins
{
id
'com.android.application'
id
'org.jetbrains.kotlin.android'
id
'com.chaquo.python'
}
android
{
...
...
@@ -14,6 +15,15 @@ android {
versionName
"1.0"
testInstrumentationRunner
"androidx.test.runner.AndroidJUnitRunner"
ndk
{
abiFilters
"armeabi-v7a"
,
"arm64-v8a"
,
"x86"
,
"x86_64"
}
python
{
version
"3.9"
buildPython
"python3.9"
}
}
buildTypes
{
...
...
@@ -45,4 +55,4 @@ dependencies {
testImplementation
'junit:junit:4.13.2'
androidTestImplementation
'androidx.test.ext:junit:1.1.3'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.4.0'
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
app/app/src/main/python/main.py
0 → 100644
+
14
−
0
View file @
46ad1e5a
from
kivy.app
import
App
from
kivy.uix.label
import
Label
class
MainApp
(
App
):
def
build
(
self
):
label
=
Label
(
text
=
'
Hello from Kivy
'
,
size_hint
=
(.
5
,
.
5
),
pos_hint
=
{
'
center_x
'
:
.
5
,
'
center_y
'
:
.
5
})
return
label
if
__name__
==
'
__main__
'
:
app
=
MainApp
()
app
.
run
()
This diff is collapsed.
Click to expand it.
app/build.gradle
+
1
−
0
View file @
46ad1e5a
...
...
@@ -3,6 +3,7 @@ plugins {
id
'com.android.application'
version
'7.2.1'
apply
false
id
'com.android.library'
version
'7.2.1'
apply
false
id
'org.jetbrains.kotlin.android'
version
'1.6.10'
apply
false
id
'com.chaquo.python'
version
'13.0.0'
apply
false
}
task
clean
(
type:
Delete
)
{
...
...
This diff is collapsed.
Click to expand it.
flake.nix
+
64
−
2
View file @
46ad1e5a
...
...
@@ -28,7 +28,9 @@
};
};
outputs
=
{
self
,
nixpkgs
,
flake-utils
,
mach-nix-flake
,
buildozerSrc
,
pythonForAndroidSrc
,
...
}:
flake-utils
.
lib
.
eachSystem
[
"x86_64-linux"
]
(
system
:
let
flake-utils
.
lib
.
eachSystem
[
"x86_64-linux"
]
(
system
:
let
mach-nix
=
mach-nix-flake
.
lib
.
${
system
};
pkgs
=
import
nixpkgs
{
...
...
@@ -68,10 +70,69 @@
androidComposition
=
pkgs
.
callPackage
./android.nix
{
inherit
cmakeVersion
;
};
getBuildInputs
=
getInputs
:
xs
:
builtins
.
foldl
'
(
accum
:
drv
:
(
getInputs
drv
)
++
accum
)
[]
xs
;
chaquopy-env
=
mach-nix
.
mkPython
{
python
=
"python39"
;
requirements
=
''
chaquopy
''
;
};
in
{
packages
.
default
=
pkgs
.
androidenv
.
buildApp
{
name
=
"PrivateStorage Mobile"
;
src
=
./app
;
release
=
false
;
platformVersions
=
[
"27"
];
includeNDK
=
false
;
};
apps
.
emulator
=
{
type
=
"app"
;
program
=
let
emulator
=
pkgs
.
androidenv
.
emulateApp
{
name
=
"PrivateStorage Mobile"
;
platformVersion
=
"27"
;
abiVersion
=
"x86_64"
;
systemImageType
=
"default"
;
app
=
./app/app/build/outputs/apk/debug/app-debug.apk
;
package
=
"MyApp"
;
activity
=
"MainActivity"
;
};
in
"
${
emulator
}
/bin/emulate-it???"
;
};
devShells
.
gradle
=
pkgs
.
mkShell
rec
{
name
=
"nix-native"
;
version
=
"2022.11.09"
;
ANDROIDSDK
=
"
${
androidComposition
.
androidsdk
}
/libexec/android-sdk"
;
ANDROIDNDK
=
"
${
ANDROIDSDK
}
/ndk-bundle"
;
buildInputs
=
with
pkgs
;
[
# XXXX
# gradle finds an aapk2 from some random tgz it downloads from internet instead of from our ANDROIDSDK! GREAT!!!!!!!!!!11111
#
# Fix the one it downloads, if it didn't already root you, with:
#
# patchelf --set-interpreter <correct ld.so> ~/.gradle/<...path to aapt2>
gradle
ant
# openjdk8
android-studio
android-tools
python39
];
};
devShells
.
default
=
self
.
devShells
.
${
system
}
.
gradle
;
# https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/android.section.md
# is a good reference for this stuff.
devShells
.
default
=
pkgs
.
mkShell
rec
{
devShells
.
kivy
=
pkgs
.
mkShell
rec
{
name
=
"ps-mobile"
;
version
=
"2022.10.21"
;
...
...
@@ -86,6 +147,7 @@
buildInputs
=
with
pkgs
;
[
android-studio
android-tools
kivy-env
# Kivy and python-for-android depend on:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment