mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-05 19:28:46 +02:00
Remove unnecessary files
This commit is contained in:
parent
44d9bab2b0
commit
6c2e5ea779
1557 changed files with 308 additions and 113830 deletions
157
tools/buck/buck-2be0e8fa79117daa854e79dd7d9ce32048d506a8.patch
Normal file
157
tools/buck/buck-2be0e8fa79117daa854e79dd7d9ce32048d506a8.patch
Normal file
|
|
@ -0,0 +1,157 @@
|
|||
diff --git a/.gitignore b/.gitignore
|
||||
index 78ce658b9a..30c0369ab7 100644
|
||||
--- a/.gitignore
|
||||
+++ b/.gitignore
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
# IntelliJ build
|
||||
/intellij-out/
|
||||
+/.idea/
|
||||
|
||||
# Buck
|
||||
/buck-out
|
||||
diff --git a/.idea/modules.xml b/.idea/modules.xml
|
||||
deleted file mode 100644
|
||||
index 7ff823b554..0000000000
|
||||
--- a/.idea/modules.xml
|
||||
+++ /dev/null
|
||||
@@ -1,16 +0,0 @@
|
||||
-<?xml version="1.0" encoding="UTF-8"?>
|
||||
-<project version="4">
|
||||
- <component name="ProjectModuleManager">
|
||||
- <modules>
|
||||
- <module fileurl="file://$PROJECT_DIR$/buck.iml" filepath="$PROJECT_DIR$/buck.iml" />
|
||||
- <module fileurl="file://$PROJECT_DIR$/tools/consistency_checker/consistency_checker.iml" filepath="$PROJECT_DIR$/tools/consistency_checker/consistency_checker.iml" />
|
||||
- <module fileurl="file://$PROJECT_DIR$/tools/documentation_generator/documentation_generator.iml" filepath="$PROJECT_DIR$/tools/documentation_generator/documentation_generator.iml" />
|
||||
- <module fileurl="file://$PROJECT_DIR$/tools/build/modules/modules.iml" filepath="$PROJECT_DIR$/tools/build/modules/modules.iml" />
|
||||
- <module fileurl="file://$PROJECT_DIR$/src/com/facebook/buck/multitenant/multitenant.iml" filepath="$PROJECT_DIR$/src/com/facebook/buck/multitenant/multitenant.iml" />
|
||||
- <module fileurl="file://$PROJECT_DIR$/programs/programs.iml" filepath="$PROJECT_DIR$/programs/programs.iml" />
|
||||
- <module fileurl="file://$PROJECT_DIR$/skunkworks/protobuck/protobuck.iml" filepath="$PROJECT_DIR$/skunkworks/protobuck/protobuck.iml" />
|
||||
- <module fileurl="file://$PROJECT_DIR$/python-dsl/python-dsl.iml" filepath="$PROJECT_DIR$/python-dsl/python-dsl.iml" />
|
||||
- <module fileurl="file://$PROJECT_DIR$/scripts/scripts.iml" filepath="$PROJECT_DIR$/scripts/scripts.iml" />
|
||||
- </modules>
|
||||
- </component>
|
||||
-</project>
|
||||
\ No newline at end of file
|
||||
diff --git a/src/com/facebook/buck/apple/AppleBundle.java b/src/com/facebook/buck/apple/AppleBundle.java
|
||||
index d895ab9a79..ad42beb302 100644
|
||||
--- a/src/com/facebook/buck/apple/AppleBundle.java
|
||||
+++ b/src/com/facebook/buck/apple/AppleBundle.java
|
||||
@@ -992,7 +992,11 @@ public class AppleBundle extends AbstractBuildRuleWithDeclaredAndExtraDeps
|
||||
keys.put("DTPlatformName", new NSString(platform.getName()));
|
||||
keys.put("DTPlatformVersion", new NSString(sdkVersion));
|
||||
keys.put("DTSDKName", new NSString(sdkName + sdkVersion));
|
||||
- keys.put("MinimumOSVersion", new NSString(minOSVersion));
|
||||
+ if (infoPlistSubstitutions.containsKey("MinimumOSVersion")) {
|
||||
+ keys.put("MinimumOSVersion", new NSString(infoPlistSubstitutions.get("MinimumOSVersion")));
|
||||
+ } else {
|
||||
+ keys.put("MinimumOSVersion", new NSString(minOSVersion));
|
||||
+ }
|
||||
if (platformBuildVersion.isPresent()) {
|
||||
keys.put("DTPlatformBuild", new NSString(platformBuildVersion.get()));
|
||||
keys.put("DTSDKBuild", new NSString(platformBuildVersion.get()));
|
||||
@@ -1185,9 +1189,10 @@ public class AppleBundle extends AbstractBuildRuleWithDeclaredAndExtraDeps
|
||||
|
||||
// .framework bundles will be code-signed when they're copied into the containing bundle.
|
||||
private boolean needCodeSign() {
|
||||
- return binary.isPresent()
|
||||
+ return false;
|
||||
+ /*return binary.isPresent()
|
||||
&& ApplePlatform.needsCodeSign(platform.getName())
|
||||
- && !extension.equals(FRAMEWORK_EXTENSION);
|
||||
+ && !extension.equals(FRAMEWORK_EXTENSION);*/
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/com/facebook/buck/apple/MultiarchFileInfos.java b/src/com/facebook/buck/apple/MultiarchFileInfos.java
|
||||
index c078b2e134..030f9fc289 100644
|
||||
--- a/src/com/facebook/buck/apple/MultiarchFileInfos.java
|
||||
+++ b/src/com/facebook/buck/apple/MultiarchFileInfos.java
|
||||
@@ -177,7 +177,12 @@ public class MultiarchFileInfos {
|
||||
cxxBuckConfig.shouldCacheLinks(),
|
||||
BuildTargetPaths.getGenPath(
|
||||
projectFilesystem, buildTarget, multiarchOutputPathFormat));
|
||||
- graphBuilder.addToIndex(multiarchFile);
|
||||
+ Optional<BuildRule> existingRule2 = graphBuilder.getRuleOptional(multiarchFile.getBuildTarget());
|
||||
+ if (existingRule2.isPresent()) {
|
||||
+ return existingRule2.get();
|
||||
+ } else {
|
||||
+ graphBuilder.addToIndex(multiarchFile);
|
||||
+ }
|
||||
return multiarchFile;
|
||||
} else {
|
||||
return new NoopBuildRule(buildTarget, projectFilesystem);
|
||||
diff --git a/src/com/facebook/buck/features/apple/project/ProjectGenerator.java b/src/com/facebook/buck/features/apple/project/ProjectGenerator.java
|
||||
index 8db968b982..b10f793d8e 100644
|
||||
--- a/src/com/facebook/buck/features/apple/project/ProjectGenerator.java
|
||||
+++ b/src/com/facebook/buck/features/apple/project/ProjectGenerator.java
|
||||
@@ -825,6 +825,7 @@ public class ProjectGenerator {
|
||||
Optional.of(xcodeDescriptions.getXCodeDescriptions()));
|
||||
if (bundleRequiresRemovalOfAllTransitiveFrameworks(targetNode)) {
|
||||
copiedRules = rulesWithoutFrameworkBundles(copiedRules);
|
||||
+ copiedRules = rulesWithoutDylibs(copiedRules);
|
||||
} else if (bundleRequiresAllTransitiveFrameworks(binaryNode, bundleLoaderNode)) {
|
||||
copiedRules =
|
||||
ImmutableSet.<TargetNode<?>>builder()
|
||||
@@ -954,6 +955,22 @@ public class ProjectGenerator {
|
||||
.toImmutableList();
|
||||
}
|
||||
|
||||
+ private ImmutableList<TargetNode<?>> rulesWithoutDylibs(
|
||||
+ Iterable<TargetNode<?>> copiedRules) {
|
||||
+ return RichStream.from(copiedRules)
|
||||
+ .filter(
|
||||
+ input ->
|
||||
+ TargetNodes.castArg(input, AppleLibraryDescriptionArg.class)
|
||||
+ .map(argTargetNode -> {
|
||||
+ if (argTargetNode.getBuildTarget().getFlavors().contains(CxxDescriptionEnhancer.SHARED_FLAVOR)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ return true;
|
||||
+ })
|
||||
+ .orElse(true))
|
||||
+ .toImmutableList();
|
||||
+ }
|
||||
+
|
||||
private ImmutableList<TargetNode<?>> rulesWithoutBundleLoader(
|
||||
Iterable<TargetNode<?>> copiedRules, TargetNode<?> bundleLoader) {
|
||||
return RichStream.from(copiedRules).filter(x -> !bundleLoader.equals(x)).toImmutableList();
|
||||
@@ -2316,8 +2333,9 @@ public class ProjectGenerator {
|
||||
.transform(
|
||||
bundleExtension -> {
|
||||
switch (bundleExtension) {
|
||||
- case APP:
|
||||
case APPEX:
|
||||
+ return false;
|
||||
+ case APP:
|
||||
case PLUGIN:
|
||||
case BUNDLE:
|
||||
case XCTEST:
|
||||
@@ -2515,7 +2533,7 @@ public class ProjectGenerator {
|
||||
|
||||
librarySearchPaths.add("$DT_TOOLCHAIN_DIR/usr/lib/swift/$PLATFORM_NAME");
|
||||
if (options.shouldLinkSystemSwift()) {
|
||||
- librarySearchPaths.add("$DT_TOOLCHAIN_DIR/usr/lib/swift-5.0/$PLATFORM_NAME");
|
||||
+ //librarySearchPaths.add("$DT_TOOLCHAIN_DIR/usr/lib/swift-5.0/$PLATFORM_NAME");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3444,7 +3462,7 @@ public class ProjectGenerator {
|
||||
|
||||
PBXFileReference fileReference = getLibraryFileReference(targetNode);
|
||||
PBXBuildFile buildFile = new PBXBuildFile(fileReference);
|
||||
- if (fileReference.getExplicitFileType().equals(Optional.of("wrapper.framework"))) {
|
||||
+ if (fileReference.getExplicitFileType().equals(Optional.of("wrapper.framework")) || fileReference.getExplicitFileType().equals(Optional.of("compiled.mach-o.dylib"))) {
|
||||
UnflavoredBuildTargetView buildTarget =
|
||||
targetNode.getBuildTarget().getUnflavoredBuildTarget();
|
||||
if (frameworkTargets.contains(buildTarget)) {
|
||||
@@ -4696,6 +4714,9 @@ public class ProjectGenerator {
|
||||
|
||||
private static boolean bundleRequiresRemovalOfAllTransitiveFrameworks(
|
||||
TargetNode<? extends HasAppleBundleFields> targetNode) {
|
||||
+ if (targetNode.getConstructorArg().getXcodeProductType().equals(Optional.of("com.apple.product-type.app-extension"))) {
|
||||
+ return true;
|
||||
+ }
|
||||
return isFrameworkBundle(targetNode.getConstructorArg());
|
||||
}
|
||||
|
||||
48
tools/buck/prepare_buck_source.sh
Normal file
48
tools/buck/prepare_buck_source.sh
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -x
|
||||
set -e
|
||||
|
||||
target_directory="$1"
|
||||
|
||||
if [ -z "$target_directory" ]; then
|
||||
echo "Usage: sh prepare_buck_source.sh path/to/target/directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$target_directory"
|
||||
|
||||
patch_file="$(ls *.patch | head -1)"
|
||||
patch_path="$(pwd)/$patch_file"
|
||||
|
||||
if [ -z "$patch_file" ]; then
|
||||
echo "There should be a patch-COMMIT_SHA.patch in the current directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
commit_sha="$(echo "$patch_file" | sed -e 's/buck-//g' | sed -e 's/\.patch//g')"
|
||||
|
||||
echo "Fetching commit $commit_sha"
|
||||
|
||||
dir="$(pwd)"
|
||||
cd "$target_directory"
|
||||
|
||||
if [ ! -d "buck" ]; then
|
||||
git clone "https://github.com/facebook/buck.git"
|
||||
fi
|
||||
|
||||
cd "buck"
|
||||
|
||||
git reset --hard
|
||||
git reset --hard "$commit_sha"
|
||||
|
||||
git apply --check "$patch_path"
|
||||
git apply "$patch_path"
|
||||
|
||||
ant
|
||||
|
||||
./bin/buck build --show-output buck
|
||||
|
||||
#result_path="$(pwd)/buck-out/gen/programs/buck.pex"
|
||||
|
||||
cd "$dir"
|
||||
Loading…
Add table
Add a link
Reference in a new issue