Browse Source

Add install script to pepMacOSAdapter. Delete unused scripts in PEPObjCAdapterXPCService.

APPLEMAIL-42
David Alarcon 5 months ago
parent
commit
cf4f493e7c
5 changed files with 116 additions and 44 deletions
  1. +25
    -0
      Scripts/Install.sh
  2. +0
    -12
      Subprojects/PEPObjCAdapterXPCService/PEPObjCAdapterXPCService.xcodeproj/project.pbxproj
  3. +0
    -18
      Subprojects/PEPObjCAdapterXPCService/Scripts/Install.sh
  4. +0
    -14
      Subprojects/PEPObjCAdapterXPCService/Scripts/Uninstall.sh
  5. +91
    -0
      pEpMacOSAdapter.xcodeproj/project.pbxproj

+ 25
- 0
Scripts/Install.sh View File

@ -0,0 +1,25 @@
#!/bin/sh
# Install.sh
# pEpMacOSAdapter
#
# Created by David Alarcon on 12/4/21.
# Copyright © 2021 p≡p foundation. All rights reserved.
buildProductsDir=$1
projectName=$2
uid=$3
plist=foundation.pEp.adapter.macOS.plist
# Copy the service plist to LaunchAgents
cp $projectName/$plist /Library/LaunchAgents
# Unload the service
launchctl asuser $uid launchctl unload /Library/LaunchAgents/$plist
# Copy the service executable
cp -f "$buildProductsDir/foundation.pEp.adapter.macOS.xpc/Contents/MacOS/foundation.pEp.adapter.macOS" "/Library/Application Support/pEp/pEp.app/Contents/MacOS"
# Load the service
launchctl asuser $uid launchctl load /Library/LaunchAgents/$plist

+ 0
- 12
Subprojects/PEPObjCAdapterXPCService/PEPObjCAdapterXPCService.xcodeproj/project.pbxproj View File

@ -34,8 +34,6 @@
4EC2A5E525AEFCC9000ACF79 /* PEPObjCAdapterXPCTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PEPObjCAdapterXPCTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
4EC2A5EA25AEFCC9000ACF79 /* PEPObjCAdapterXpcApiClientTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPObjCAdapterXpcApiClientTests.m; sourceTree = "<group>"; };
4EC2A5EC25AEFCC9000ACF79 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4EC2A62A25AEFFEB000ACF79 /* Uninstall.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = Uninstall.sh; sourceTree = "<group>"; };
4EC2A62B25AEFFEB000ACF79 /* Install.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = Install.sh; sourceTree = "<group>"; };
4EC2A68925AF4378000ACF79 /* PEPObjCAdapterXPCApiClientService.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPObjCAdapterXPCApiClientService.h; sourceTree = "<group>"; };
4EC2A68A25AF4378000ACF79 /* PEPObjCAdapterXPCApiClientService.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPObjCAdapterXPCApiClientService.m; sourceTree = "<group>"; };
4ED6F5D625D2D39C008BCE79 /* PEPObjCAdapterXPCServiceTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PEPObjCAdapterXPCServiceTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
@ -133,7 +131,6 @@
4ED6F72625D2ECE5008BCE79 /* PEPObjCAdapterXPCService */,
4EC2A5E925AEFCC9000ACF79 /* PEPObjCAdapterXpcApiClientTests */,
4ED6F5DA25D2D39C008BCE79 /* PEPObjCAdapterXPCServiceTests */,
4EC2A62925AEFFEB000ACF79 /* Scripts */,
4EC2A5DD25AEFCC8000ACF79 /* Products */,
4EA9B4B525BF005A0048427E /* Frameworks */,
);
@ -159,15 +156,6 @@
path = PEPObjCAdapterXpcApiClientTests;
sourceTree = "<group>";
};
4EC2A62925AEFFEB000ACF79 /* Scripts */ = {
isa = PBXGroup;
children = (
4EC2A62A25AEFFEB000ACF79 /* Uninstall.sh */,
4EC2A62B25AEFFEB000ACF79 /* Install.sh */,
);
path = Scripts;
sourceTree = "<group>";
};
4ED6F5DA25D2D39C008BCE79 /* PEPObjCAdapterXPCServiceTests */ = {
isa = PBXGroup;
children = (


+ 0
- 18
Subprojects/PEPObjCAdapterXPCService/Scripts/Install.sh View File

@ -1,18 +0,0 @@
#!/bin/sh
# Install.sh
# pEpXPCAdapterClient
#
# Created by David Alarcon on 14/09/2020.
# Copyright © 2020 p≡p foundation. All rights reserved.
BUILT_PRODUCTS_DIR=$1
# Copy the daemon's launchd.plist into /Library/LaunchDaemons
for framework in PEPObjCAdapterXpcApiClient.framework
do
trg=/Library/Frameworks/
rsync -av ${BUILT_PRODUCTS_DIR}/${framework} ${trg}
chown -R root:wheel ${trg}/${framework}
chmod -R 755 ${trg}/${framework}
done

+ 0
- 14
Subprojects/PEPObjCAdapterXPCService/Scripts/Uninstall.sh View File

@ -1,14 +0,0 @@
#!/bin/sh
# Uninstall.sh
# pEpXPCAdapterClient
#
# Created by David Alarcon on 14/09/2020.
# Copyright © 2020 p≡p foundation. All rights reserved.
echo "Uninstall Framework ..."
for framework in PEPObjCAdapterXpcApiClient.framework
do
trg=/Library/Frameworks/${framework}
rm -Rf ${trg}
done

+ 91
- 0
pEpMacOSAdapter.xcodeproj/project.pbxproj View File

@ -6,6 +6,21 @@
objectVersion = 50;
objects = {
/* Begin PBXAggregateTarget section */
4E44A4C226247559001F9D55 /* Install pEpMacOSAdapter Service */ = {
isa = PBXAggregateTarget;
buildConfigurationList = 4E44A4C326247559001F9D55 /* Build configuration list for PBXAggregateTarget "Install pEpMacOSAdapter Service" */;
buildPhases = (
4E44A4CC2624755E001F9D55 /* ShellScript */,
);
dependencies = (
4E44A4CE262475A0001F9D55 /* PBXTargetDependency */,
);
name = "Install pEpMacOSAdapter Service";
productName = "Install pEpMacOSAdapter Service";
};
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
15921F41261DC6FA003346B7 /* DummyToBrigeFoundationToSwift.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15921F40261DC6FA003346B7 /* DummyToBrigeFoundationToSwift.swift */; };
35380AE7247BD13A004A08A6 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 35380AE6247BD13A004A08A6 /* README.md */; };
@ -18,6 +33,16 @@
4EA1945E25D6943500F5D802 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 4EA1945D25D6942D00F5D802 /* libc++.tbd */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
4E44A4CD262475A0001F9D55 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 35DC18CA244DA19100FB2002 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 35DC18D1244DA19100FB2002;
remoteInfo = foundation.pEp.adapter.macOS;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
15921EF3261DC63B003346B7 /* foundation.pEp.adapter.macOS-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "foundation.pEp.adapter.macOS-Bridging-Header.h"; sourceTree = "<group>"; };
15921F40261DC6FA003346B7 /* DummyToBrigeFoundationToSwift.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DummyToBrigeFoundationToSwift.swift; sourceTree = "<group>"; };
@ -25,6 +50,7 @@
35DC18D2244DA19100FB2002 /* foundation.pEp.adapter.macOS.xpc */ = {isa = PBXFileReference; explicitFileType = "wrapper.xpc-service"; includeInIndex = 0; path = foundation.pEp.adapter.macOS.xpc; sourceTree = BUILT_PRODUCTS_DIR; };
35DC18D9244DA19100FB2002 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
35DC18DB244DA19100FB2002 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4E44A4C1262473C6001F9D55 /* Install.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = Install.sh; sourceTree = "<group>"; };
4E591BEF261EF77800CFB547 /* foundation.pEp.adapter.macOS.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = foundation.pEp.adapter.macOS.plist; sourceTree = "<group>"; };
4E5FC0F025B9D2CF000DF12C /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
4E9F55CF25D3D4B8005BD46F /* libPEPObjCAdapterXPCService.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libPEPObjCAdapterXPCService.a; sourceTree = BUILT_PRODUCTS_DIR; };
@ -53,6 +79,7 @@
isa = PBXGroup;
children = (
35DC18D4244DA19100FB2002 /* pEpMacOSAdapter */,
4E44A4C0262473AB001F9D55 /* Scripts */,
35DC18D3244DA19100FB2002 /* Products */,
35F06969247D58C800543884 /* Frameworks */,
);
@ -91,6 +118,14 @@
name = Frameworks;
sourceTree = "<group>";
};
4E44A4C0262473AB001F9D55 /* Scripts */ = {
isa = PBXGroup;
children = (
4E44A4C1262473C6001F9D55 /* Install.sh */,
);
path = Scripts;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@ -125,6 +160,9 @@
CreatedOnToolsVersion = 11.4.1;
LastSwiftMigration = 1240;
};
4E44A4C226247559001F9D55 = {
CreatedOnToolsVersion = 12.4;
};
};
};
buildConfigurationList = 35DC18CD244DA19100FB2002 /* Build configuration list for PBXProject "pEpMacOSAdapter" */;
@ -141,6 +179,7 @@
projectRoot = "";
targets = (
35DC18D1244DA19100FB2002 /* foundation.pEp.adapter.macOS */,
4E44A4C226247559001F9D55 /* Install pEpMacOSAdapter Service */,
);
};
/* End PBXProject section */
@ -176,6 +215,23 @@
shellPath = /bin/sh;
shellScript = "CUSTOM_BUILD_DIR=${PROJECT_DIR}/build\nmkdir -p ${CUSTOM_BUILD_DIR}\ncp -r \"${BUILD_DIR}/${CONFIGURATION}/foundation.pEp.adapter.macOS.xpc\" ${CUSTOM_BUILD_DIR}\n";
};
4E44A4CC2624755E001F9D55 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "osascript -e 'do shell script \"${PROJECT_DIR}/Scripts/Install.sh ${BUILT_PRODUCTS_DIR} ${PROJECT_NAME} ${UID}\" with administrator privileges'\n";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@ -190,6 +246,14 @@
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
4E44A4CE262475A0001F9D55 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 35DC18D1244DA19100FB2002 /* foundation.pEp.adapter.macOS */;
targetProxy = 4E44A4CD262475A0001F9D55 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
35DC18DC244DA19100FB2002 /* Debug */ = {
isa = XCBuildConfiguration;
@ -389,6 +453,24 @@
};
name = Release;
};
4E44A4C426247559001F9D55 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = NQLYU6MGPN;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
4E44A4C526247559001F9D55 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = NQLYU6MGPN;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
@ -410,6 +492,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
4E44A4C326247559001F9D55 /* Build configuration list for PBXAggregateTarget "Install pEpMacOSAdapter Service" */ = {
isa = XCConfigurationList;
buildConfigurations = (
4E44A4C426247559001F9D55 /* Debug */,
4E44A4C526247559001F9D55 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 35DC18CA244DA19100FB2002 /* Project object */;


Loading…
Cancel
Save