mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Cleanup
This commit is contained in:
parent
0426351ee8
commit
2805b1715c
267 changed files with 0 additions and 8770 deletions
|
|
@ -1,157 +0,0 @@
|
|||
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());
|
||||
}
|
||||
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
#!/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"
|
||||
|
||||
jdk_archive_name="jdk.tar.gz"
|
||||
jdk_archive_path="$target_directory/$jdk_archive_name"
|
||||
jdk_unpacked_path="$target_directory/jdk8u232-b09"
|
||||
jdk_url="https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u232-b09/OpenJDK8U-jdk_x64_mac_hotspot_8u232b09.tar.gz"
|
||||
|
||||
if [ ! -f "$jdk_archive_path" ]; then
|
||||
echo "Fetching JDK 8"
|
||||
curl "$jdk_url" -L -o "$target_directory/jdk.tar.gz"
|
||||
fi
|
||||
|
||||
if [ ! -d "$jdk_unpacked_path" ]; then
|
||||
echo "Unpacking JDK 8"
|
||||
pushd "$target_directory"
|
||||
tar -xf "$jdk_archive_name"
|
||||
popd
|
||||
fi
|
||||
|
||||
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"
|
||||
|
||||
PATH="$PATH:$jdk_unpacked_path/Contents/Home/bin" ant
|
||||
PATH="$PATH:$jdk_unpacked_path/Contents/Home/bin" ./bin/buck build --show-output buck
|
||||
|
||||
cd "$dir"
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
XCODE_BINARY_CONFIG = {
|
||||
'IPHONEOS_DEPLOYMENT_TARGET': '8.0',
|
||||
'SDKROOT': 'iphoneos',
|
||||
'GCC_OPTIMIZATION_LEVEL': '0',
|
||||
'SWIFT_OPTIMIZATION_LEVEL': '-Onone',
|
||||
'SWIFT_WHOLE_MODULE_OPTIMIZATION': 'NO',
|
||||
'ONLY_ACTIVE_ARCH': 'YES',
|
||||
'LD_RUNPATH_SEARCH_PATHS': '@executable_path/Frameworks',
|
||||
}
|
||||
|
||||
XCODE_STATIC_LIBRARY_CONFIG = {
|
||||
'SKIP_INSTALL': 'YES',
|
||||
}
|
||||
103
tools/utils.bzl
103
tools/utils.bzl
|
|
@ -1,103 +0,0 @@
|
|||
OTHER_LINKER_FLAGS_KEY = 'OTHER_LDFLAGS'
|
||||
|
||||
def config_with_updated_linker_flags(config, other_linker_flags, config_key=OTHER_LINKER_FLAGS_KEY):
|
||||
new_config = { }
|
||||
config_key_found = False
|
||||
for key in config:
|
||||
if key == config_key:
|
||||
new_config[key] = config[key] + (" %s" % other_linker_flags)
|
||||
config_key_found = True
|
||||
else:
|
||||
new_config[key] = config[key]
|
||||
|
||||
if config_key_found == False:
|
||||
# If `config` does not currently contain `config_key`, add it. Inherit for good measure.
|
||||
new_config[config_key] = '$(inherited) ' + other_linker_flags
|
||||
|
||||
return new_config
|
||||
|
||||
|
||||
def xcode_configs(config):
|
||||
return {
|
||||
"Debug": config,
|
||||
"Profile": config,
|
||||
"Release": config,
|
||||
}
|
||||
|
||||
def merge_maps(dicts):
|
||||
result = dict()
|
||||
for d in dicts:
|
||||
for key in d:
|
||||
if key in result and result[key] != d[key]:
|
||||
fail(
|
||||
"Conflicting files in file search paths. " +
|
||||
"\"%s\" maps to both \"%s\" and \"%s\"." %
|
||||
(key, result[key], d[key]),
|
||||
)
|
||||
result.update(d)
|
||||
return result
|
||||
|
||||
|
||||
def basename(p):
|
||||
return p.rpartition("/")[-1]
|
||||
|
||||
|
||||
def glob_map(glob_results):
|
||||
result = dict()
|
||||
for path in glob_results:
|
||||
file_name = basename(path)
|
||||
if file_name in result:
|
||||
fail('\"%s\" maps to both \"%s\" and \"%s\"' % (file_name, result[file_name], path))
|
||||
result[file_name] = path
|
||||
return result
|
||||
|
||||
|
||||
def glob_sub_map(prefix, glob_specs):
|
||||
result = dict()
|
||||
for path in native.glob(glob_specs):
|
||||
if not path.startswith(prefix):
|
||||
fail('\"%s\" does not start with \"%s\"' % (path, prefix))
|
||||
file_key = path[len(prefix):]
|
||||
if file_key in result:
|
||||
fail('\"%s\" maps to both \"%s\" and \"%s\"' % (file_key, result[file_key], path))
|
||||
result[file_key] = path
|
||||
return result
|
||||
|
||||
|
||||
def gen_header_targets(header_paths, prefix, flavor, source_rule, source_path):
|
||||
result = dict()
|
||||
for header_path in header_paths:
|
||||
name = prefix + header_path.replace('/', '_sub_')
|
||||
native.genrule(
|
||||
name = name + flavor,
|
||||
cmd = 'cp $(location :' + source_rule + ')/' + source_path + '/' + header_path + ' $OUT',
|
||||
out = name,
|
||||
)
|
||||
result[header_path] = ':' + name + flavor
|
||||
return result
|
||||
|
||||
|
||||
def lib_basename(name):
|
||||
result = name
|
||||
if result.startswith('lib'):
|
||||
result = result[3:]
|
||||
if result.endswith('.a'):
|
||||
result = result[:-2]
|
||||
return result
|
||||
|
||||
|
||||
def combined_config(dicts):
|
||||
result = dict()
|
||||
for d in dicts:
|
||||
result.update(d)
|
||||
return result
|
||||
|
||||
|
||||
valid_build_variants = ['project', 'release']
|
||||
|
||||
def get_build_variant():
|
||||
build_variant = native.read_config('build', 'variant', '')
|
||||
if build_variant not in valid_build_variants:
|
||||
fail('build_variant should be one of %s' % valid_build_variants)
|
||||
return build_variant
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue