Skip to content

Commit

Permalink
Merge branch 'develop' into haskell-language-server
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-abrar authored Aug 13, 2021
2 parents 04ba213 + 904eea8 commit 21eca40
Show file tree
Hide file tree
Showing 39 changed files with 1,330 additions and 408 deletions.
34 changes: 33 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,23 @@

This project's release branch is `master`. This log is written from the perspective of the release branch: when changes hit `master`, they are considered released.

## v0.6.2.0
## Unreleased

* Bump
* patch to 0.0.4.0

## v0.7.1.0

* Bump
* reflex to 0.8.1.0
* reflex-dom-core to 0.6.2.0
* jsaddle to 0.9.7.1
* jsaddle-dom to 0.9.4.1
* New pins
* hnix 0.12.0.1 and dependencies
* dependent-monoidal-map 0.1.1.2

## v0.7.0.0

* Bump
* all-cabal-hashes ("Update from Hackage at 2020-12-01T14:56:13Z")
Expand All @@ -11,6 +27,22 @@ This project's release branch is `master`. This log is written from the perspect
* beam-postgres to 0.5.0.0
* New pins
* [beam-automigrate](https://github.com/obsidiansystems/beam-automigrate) 0.1.0.0
* Android
* Add allowBackup/fullBackupContent to manifest
* Bump gradle to v3.4.0 and upgrade related maven dependencies
* Allow maven dependencies to be overridden
* Copy google-services.json to the location expected by google integrations
* Disable multi-dex on android builds (see [note](https://github.com/reflex-frp/reflex-platform/commit/0e3e94467ab117832989632d65cfcc9afd538809))
* Update to android sdk version 29
* iOS
* Copy default splash screen images and app icon into sample application
* Make ios-deploy tool overridable
* Update iosSdkVersion to 13.2
* Make xcode version customizable
* Remove ResourceRules.plist as it is no longer necessary
* Set CFBundleIconName as required by App Store
* Add portable-deploy script for iOS for creating a pre-signed tarball which can be tested without Nix.
* Add iOS Simulator target

## v0.6.1.0

Expand Down
12 changes: 10 additions & 2 deletions android/AndroidManifest.xml.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,24 @@
, intentFilters
, services
, permissions
, allowBackup ? false
, fullBackupContent ? allowBackup
, usesCleartextTraffic ? false
}:
''
let
boolStr = x: if x then "true" else "false";
in ''
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="${applicationId}"
android:versionCode="${version.code}"
android:versionName="${version.name}">
<application android:label="@string/app_name"
android:icon="${iconPath}"
android:hardwareAccelerated="true">
android:allowBackup="${boolStr allowBackup}"
android:fullBackupContent="${boolStr fullBackupContent}"
android:hardwareAccelerated="true"
android:usesCleartextTraffic="${boolStr usesCleartextTraffic}">
<activity android:name="systems.obsidian.HaskellActivity"
android:label="@string/app_name"
android:configChanges="orientation|screenSize"
Expand Down
29 changes: 18 additions & 11 deletions android/build-gradle-app.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
, which, gradle, fetchurl, buildEnv, runCommand }:

args@{ name, src, platformVersions ? [ "8" ]
, buildToolsVersions ? [ "28.0.3" ]
, useGoogleAPIs ? false, useGooglePlayServices ? false
, release ? false, keyStore ? null, keyAlias ? null
, keyStorePassword ? null, keyAliasPassword ? null
Expand All @@ -18,29 +19,35 @@ let
inherit (stdenv.lib) optionalString optional;

m2install = { repo, version, artifactId, groupId
, jarSha256, pomSha256, aarSha256, suffix ? "" }:
, jarSha256, pomSha256, aarSha256, suffix ? ""
, customJarUrl ? null, customJarSuffix ? null }:
let m2Name = "${artifactId}-${version}";
m2Path = "${builtins.replaceStrings ["."] ["/"] groupId}/${artifactId}/${version}";
jarFile = fetchurl {
url = if customJarUrl != null then customJarUrl else "${repo}${m2Path}/${m2Name}${suffix}.jar";
sha256 = jarSha256;
};
in runCommand m2Name {} (''
mkdir -p $out/m2/${m2Path}
installPath="$out"/m2/'${m2Path}'
mkdir -p "$installPath"
'' + optionalString (jarSha256 != null) ''
install -D ${fetchurl {
url = "${repo}${m2Path}/${m2Name}${suffix}.jar";
sha256 = jarSha256;
}} $out/m2/${m2Path}/${m2Name}${suffix}.jar
install -D '${jarFile}' "$installPath"/'${m2Name}${suffix}.jar'
${optionalString (customJarSuffix != null) ''
install -D '${jarFile}' "$installPath"/'${m2Name}${suffix}${customJarSuffix}.jar'
''}
'' + optionalString (pomSha256 != null) ''
install -D ${fetchurl {
url = "${repo}${m2Path}/${m2Name}${suffix}.pom";
sha256 = pomSha256;
}} $out/m2/${m2Path}/${m2Name}${suffix}.pom
}} "$installPath/${m2Name}${suffix}.pom"
'' + optionalString (aarSha256 != null) ''
install -D ${fetchurl {
url = "${repo}${m2Path}/${m2Name}${suffix}.aar";
sha256 = aarSha256;
}} $out/m2/${m2Path}/${m2Name}${suffix}.aar
}} "$installPath/${m2Name}${suffix}.aar"
'');
androidsdkComposition = androidenv.composeAndroidPackages {
inherit platformVersions useGoogleAPIs;
inherit platformVersions useGoogleAPIs buildToolsVersions;
includeExtras = [ "extras;android;m2repository" ]
++ optional useGooglePlayServices "extras;google;google_play_services";
};
Expand Down Expand Up @@ -68,7 +75,7 @@ stdenv.mkDerivation ({
) >> gradle.properties
''}
buildDir=`pwd`
cp -r $ANDROID_HOME $buildDir/local_sdk
cp -rL $ANDROID_HOME $buildDir/local_sdk
chmod -R 755 local_sdk
export ANDROID_HOME=$buildDir/local_sdk/android-sdk
# Key files cannot be stored in the user's home directory. This
Expand All @@ -88,7 +95,7 @@ stdenv.mkDerivation ({
chmod -R 755 .m2
mkdir -p .m2/repository/com/android/support
cp -RL local_sdk/android-sdk/extras/android/m2repository/com/android/support/* .m2/repository/com/android/support/
gradle ${gradleTask} --offline --no-daemon -g ./tmp -Dmaven.repo.local=`pwd`/.m2/repository
gradle ${gradleTask} --offline --no-daemon -g ./tmp -Dmaven.repo.local=$(pwd)/.m2/repository
'';

installPhase = ''
Expand Down
37 changes: 26 additions & 11 deletions android/build.gradle.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,30 @@ buildscript {
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.android.tools.lint:lint:26.4.2'
${googleServicesClasspath}
}
}
task proguard(type: proguard.gradle.ProGuardTask) {
configuration 'proguard.txt'
// injars 'build/libs/proguard-gradle-example.jar'
// outjars 'build/libs/proguard-gradle-example.out.jar'
}
allprojects {
repositories {
mavenLocal()
}
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
compileSdkVersion 29
buildToolsVersion '28.0.3'
sourceSets {
Expand All @@ -40,9 +50,10 @@ android {
defaultConfig {
applicationId "${applicationId}"
minSdkVersion 21
targetSdkVersion 28
targetSdkVersion 29
versionCode ${version.code}
versionName "${version.name}"
multiDexEnabled false
}
${if releaseKey == null then "" else ''
Expand All @@ -58,15 +69,17 @@ android {
}
buildTypes {
release {
minifyEnabled false
zipAlignEnabled true
${if releaseKey == null then "" else ''
signingConfig signingConfigs.release
''}
}
release {
minifyEnabled false
useProguard false
zipAlignEnabled true
${if releaseKey == null then "" else ''
signingConfig signingConfigs.release
''}
}
debug {
minifyEnabled false
useProguard false
debuggable true
}
}
Expand Down Expand Up @@ -107,7 +120,9 @@ android.applicationVariants.all { variant ->
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.google.firebase:firebase-iid:20.2.3'
implementation 'com.google.firebase:firebase-messaging:20.2.3'
${additionalDependencies}
}
Expand Down
13 changes: 11 additions & 2 deletions android/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ in rec {

, googleServicesJson ? null

, mavenDeps ? import ./defaults/deps.nix

, additionalDependencies ? ""

, runtimeSharedLibs ? (_: [])
Expand All @@ -114,6 +116,11 @@ in rec {
# Set this to false to build one APK per target platform. This will
# automatically transform the version code to 1000 * versionCode + offset
# where "offset" is a per-platform constant.

, usesCleartextTraffic ? false

# Can be "assembleRelease", "assembleDebug", or "bundleRelease"
, gradleTask ? (if isRelease then "assembleRelease" else "assembleDebug")
}:
assert builtins.match "^([A-Za-z][A-Za-z0-9_]*\\.)*[A-Za-z][A-Za-z0-9_]*$" applicationId != null;
nixpkgs.lib.makeOverridable impl.buildApp {
Expand All @@ -124,7 +131,6 @@ in rec {
displayName
version
releaseKey
isRelease
resources
assets
iconPath
Expand All @@ -136,6 +142,9 @@ in rec {
additionalDependencies
runtimeSharedLibs
javaSources
universalApk;
universalApk
mavenDeps
usesCleartextTraffic
gradleTask;
};
}
Loading

0 comments on commit 21eca40

Please sign in to comment.