-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add mechanisms to disable schema const
Summary: In order to avoid needing weak symbols we would have to ensure the named symbol is always available. This diff handles the case where the path is not well-known, for example because the file is included using a file-relative path instead of a repo-relative path. The file without a well-known path applies this annotation to its package statement, and is excluded from the list of transitive includes so its constant name does not have to be known. Since every file using file-relative includes would need this annotation, we instead automatically disable schema const generation for files using such includes as there are a large number and we want to bring that number down but not block schema bundling on that. Reviewed By: yoney Differential Revision: D65977818 fbshipit-source-id: 02a1351a2b0fd52332ac068c4f53212b051623e6
- Loading branch information
1 parent
3257c5e
commit 730f090
Showing
186 changed files
with
8,239 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 120 additions & 0 deletions
120
...out/android/gen-android/com/facebook/thrift/annotation_deprecated/DisableSchemaConst.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
/** | ||
* Autogenerated by Thrift | ||
* | ||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING | ||
* @generated | ||
*/ | ||
package com.facebook.thrift.annotation_deprecated; | ||
|
||
import java.util.List; | ||
import java.util.ArrayList; | ||
import java.util.Map; | ||
import java.util.HashMap; | ||
import java.util.Set; | ||
import java.util.HashSet; | ||
import java.util.Collections; | ||
import java.util.BitSet; | ||
import java.util.Arrays; | ||
import com.facebook.thrift.*; | ||
import com.facebook.thrift.annotations.*; | ||
import com.facebook.thrift.async.*; | ||
import com.facebook.thrift.meta_data.*; | ||
import com.facebook.thrift.server.*; | ||
import com.facebook.thrift.transport.*; | ||
import com.facebook.thrift.protocol.*; | ||
|
||
/** | ||
* Not a scope, just here for dependency cycle reasons. | ||
* Disables schema const injection for the program. | ||
*/ | ||
@SuppressWarnings({ "unused", "serial" }) | ||
public class DisableSchemaConst implements TBase, java.io.Serializable, Cloneable { | ||
private static final TStruct STRUCT_DESC = new TStruct("DisableSchemaConst"); | ||
|
||
|
||
public DisableSchemaConst() { | ||
} | ||
|
||
/** | ||
* Performs a deep copy on <i>other</i>. | ||
*/ | ||
public DisableSchemaConst(DisableSchemaConst other) { | ||
} | ||
|
||
public DisableSchemaConst deepCopy() { | ||
return new DisableSchemaConst(this); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object _that) { | ||
if (_that == null) | ||
return false; | ||
if (this == _that) | ||
return true; | ||
if (!(_that instanceof DisableSchemaConst)) | ||
return false; | ||
DisableSchemaConst that = (DisableSchemaConst)_that; | ||
|
||
return true; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Arrays.deepHashCode(new Object[] {}); | ||
} | ||
|
||
// This is required to satisfy the TBase interface, but can't be implemented on immutable struture. | ||
public void read(TProtocol iprot) throws TException { | ||
throw new TException("unimplemented in android immutable structure"); | ||
} | ||
|
||
public static DisableSchemaConst deserialize(TProtocol iprot) throws TException { | ||
TField __field; | ||
iprot.readStructBegin(); | ||
while (true) | ||
{ | ||
__field = iprot.readFieldBegin(); | ||
if (__field.type == TType.STOP) { | ||
break; | ||
} | ||
switch (__field.id) | ||
{ | ||
default: | ||
TProtocolUtil.skip(iprot, __field.type); | ||
break; | ||
} | ||
iprot.readFieldEnd(); | ||
} | ||
iprot.readStructEnd(); | ||
|
||
DisableSchemaConst _that; | ||
_that = new DisableSchemaConst( | ||
); | ||
_that.validate(); | ||
return _that; | ||
} | ||
|
||
public void write(TProtocol oprot) throws TException { | ||
validate(); | ||
|
||
oprot.writeStructBegin(STRUCT_DESC); | ||
oprot.writeFieldStop(); | ||
oprot.writeStructEnd(); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return toString(1, true); | ||
} | ||
|
||
@Override | ||
public String toString(int indent, boolean prettyPrint) { | ||
return TBaseHelper.toStringHelper(this, indent, prettyPrint); | ||
} | ||
|
||
public void validate() throws TException { | ||
// check for required fields | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.